cornerradius

WKInterfaceGroup bottom corner radius

南楼画角 提交于 2019-12-03 21:08:46
I am trying to set the corner radius for the bottom left and bottom right corners for a WKInterfaceGroup. I was able to set only one single radius value and that would change it for all the corners. I couldn't find a way to access the CALayer to specify it there either. Is there a way this can be done? Thanks! (The group would contain 2 labels and would be in contact with the sash in the dynamic notification interface.) You asked about WKInterfaceGroup, but from your response to @BalestraPatrick it sounds like you are specifically trying to achieve bottom corner rounding in the long-look

How to give cornerRadius for UIBezierPath

我的梦境 提交于 2019-12-03 13:18:04
I created a rectangle using following code and now I need to rounded the corners of this rectangle. but I can't find a property called layer.cornerRadius, can anyone help me ? class OvalLayer: CAShapeLayer { let animationDuration: CFTimeInterval = 0.3 override init() { super.init() fillColor = Colors.green.CGColor path = ovalPathSmall.CGPath } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } var ovalPathStart: UIBezierPath { let path = UIBezierPath(ovalInRect: CGRect(x: 0.0, y: 0.0, width: 100.0, height: 100.0)) return path } } You can use below

UIlabel layer.cornerRadius not working in iOS 7.1

不打扰是莪最后的温柔 提交于 2019-12-03 01:07:57
问题 I'm currently looking at a UILabel with the property addMessageLabel.layer.cornerRadius = 5.0f; On a device with iOS 7.0 installed, it has rounded corners. On a device with iOS 7.1 installed, it does not have rounded corners. Is this just a bug with iOS 7.1? 回答1: Set the property clipsToBounds to true addMessageLabel.clipsToBounds = true 回答2: I think the best way to set corner radius is: and be sure the "Clip Subviews" is checked: Checking "Clip Subviews" is equal to the code addMessageLabel

How to make a UIView grow in UIView.animate() with an accurate corner radius?

三世轮回 提交于 2019-12-02 20:31:48
问题 I have this project SwiftySwitch. My goal is to make the circle expand and detract maintaining the form of a circle instead of having a corner radius that is larger than the current circle height in each specific moment of the animation. This code handling the circle growing is here: func turnOn() { let tempView = UIView(frame: CGRect(x: ballDiameter / 2, y: ballDiameter / 2, width: 0, height: 0)) tempView.backgroundColor = onColor tempView.layer.cornerRadius = ballDiameter / 2 self

UIlabel layer.cornerRadius not working in iOS 7.1

筅森魡賤 提交于 2019-12-02 14:19:41
I'm currently looking at a UILabel with the property addMessageLabel.layer.cornerRadius = 5.0f; On a device with iOS 7.0 installed, it has rounded corners. On a device with iOS 7.1 installed, it does not have rounded corners. Is this just a bug with iOS 7.1? Set the property clipsToBounds to true addMessageLabel.clipsToBounds = true I think the best way to set corner radius is: and be sure the "Clip Subviews" is checked: Checking "Clip Subviews" is equal to the code addMessageLabel.clipsToBounds = YES; . Add the below two line and check it. [[addMessageLabel layer] setCornerRadius:5.0f]; [

Image not showing in imageView if I used circular image

本小妞迷上赌 提交于 2019-12-02 10:11:29
问题 I have a table view and I need to show author_img in section header. In ViewForSectionHeader method, I want to make the image to be circular. But If I did that, the images are not showing at all, no matter in simulator or in real device. If I remove the code, uiimageview will show the images normally. I set up the width and height constraint for uiimageview because I want to get fixed size of showing images. So Any ideas, please? cell.author_img.layer.cornerRadius = cell.author_img.frame.size

Image not showing in imageView if I used circular image

久未见 提交于 2019-12-02 06:59:05
I have a table view and I need to show author_img in section header. In ViewForSectionHeader method, I want to make the image to be circular. But If I did that, the images are not showing at all, no matter in simulator or in real device. If I remove the code, uiimageview will show the images normally. I set up the width and height constraint for uiimageview because I want to get fixed size of showing images. So Any ideas, please? cell.author_img.layer.cornerRadius = cell.author_img.frame.size.width/2 cell.author_img.layer.masksToBounds = true // add a boundary for thumb cell.author_img.layer

UITableView cornerRadius with border performance issues on iOS

有些话、适合烂在心里 提交于 2019-12-01 17:52:54
I have some interesting notice with scrolling performance on UITableView with cornerRadius , borderWidth and borderColor enabled. self.tableView.layer.cornerRadius = 10.f; self.tableView.layer.borderWidth = 1.0f; self.tableView.layer.borderColor = [UIColor whiteColor].CGColor; If I remove borderWidth and borderColor than scrolling gets 60 FPS no problem. As long as I add those two properties to layer FPS drops. Does anyone have a suggestion or explanation why this strange behavior happens? Many Thanks! CALayer having shouldRasterize property for this type of performance issue. Just set self

set cornerRadius and setbackgroundimage to UIButton

我只是一个虾纸丫 提交于 2019-11-29 21:15:56
I am trying to set cornerRadius of UIButton but I dont know how to do it. If I do like this: button.layer.cornerRadius = 5; works well, if I do like this : button.layer.cornerRadius = 5; [button setBackgroundColor:[UIColor colorWithPatternImage:radialGradient]]; the corners are not rounded. I know I could solve this whit [button.layer setMasksToBounds:YES]; but I specifically looking for different solution, because I add some arrows to the button and if I set mask to bounds the arrow are masked. EDIT : radialGradient is made whit func + (UIImage *)getRadialGradientImage:(CGSize)size centre:

How can I set the cornerRadius of a UIStackView?

落花浮王杯 提交于 2019-11-29 09:12:20
I'm updating my app to use UIStackViews, now that most people should have updated to iOS 9. In the old version, I made a UIView consisting of two UITextFields and set its layer.cornerRadius property. In the new version, I created a UIStackView consisting of the same two UITextFields, instead of the UIView. When I try setting its layer.cornerRadius property nothing seems to happen. The documentation doesn't seem to have any helpful/relevant information. ZHZ UIStackView just manages the position and size of its arranged views, the cornerRadius has no effect. Try to add a custom view below the