cornerradius

How to set top left and right corner radius with desired drop shadow in UITabbar?

可紊 提交于 2020-08-22 12:05:03
问题 I've spent almost a couple of hours to figure it out. However, it did not happen and finally, I had to come here. Two things are required to be achieved : Firstly I'd like to have a spontaneous corner radius at the top (which is basically TopRight & TopLeft) of UITabbar . Secondly, I'd like to have a shadow above those corner radius(shown in below image). Please have a look at below image Let me know if anything further required from my side, I'll surely provide that. Any help will be

How to set top left and right corner radius with desired drop shadow in UITabbar?

无人久伴 提交于 2020-08-22 12:03:32
问题 I've spent almost a couple of hours to figure it out. However, it did not happen and finally, I had to come here. Two things are required to be achieved : Firstly I'd like to have a spontaneous corner radius at the top (which is basically TopRight & TopLeft) of UITabbar . Secondly, I'd like to have a shadow above those corner radius(shown in below image). Please have a look at below image Let me know if anything further required from my side, I'll surely provide that. Any help will be

Round Specific Corners SwiftUI

梦想与她 提交于 2020-04-07 12:40:38
问题 I know you can use .cornerRadius() to round all the corners of a swiftUI view but is there a way to round only specific corners such as the top? 回答1: There are two options, you can use a View with a Path , or you can create a custom Shape . In both cases you can use them standalone, or in a .background(RoundedCorders(...)) Option 1: Using Path + GeometryReader (more info on GeometryReader: https://swiftui-lab.com/geometryreader-to-the-rescue/) struct ContentView : View { var body: some View {

Setting corner radius on UIDatePicker with a background color

和自甴很熟 提交于 2020-01-14 22:55:03
问题 I have a UIDatePicker in my view and have set the background color of the UIDatePicker : self.datePicker.backgroundColor = [UIColor lightTextColor]; self.datePicker.layer.cornerRadius = 10; This successfully puts a background behind the UIDatePicker ( which in iOS7 is essentially transparent ) but fails to make the rounded corners for the background that I am looking for ( I do this same thing for an image on the screen and it works perfectly ). It seems that the corner radius doesn't affect

Setting corner radius on UIDatePicker with a background color

谁说我不能喝 提交于 2020-01-14 22:54:57
问题 I have a UIDatePicker in my view and have set the background color of the UIDatePicker : self.datePicker.backgroundColor = [UIColor lightTextColor]; self.datePicker.layer.cornerRadius = 10; This successfully puts a background behind the UIDatePicker ( which in iOS7 is essentially transparent ) but fails to make the rounded corners for the background that I am looking for ( I do this same thing for an image on the screen and it works perfectly ). It seems that the corner radius doesn't affect

Setting corner radius on UIDatePicker with a background color

只愿长相守 提交于 2020-01-14 22:54:31
问题 I have a UIDatePicker in my view and have set the background color of the UIDatePicker : self.datePicker.backgroundColor = [UIColor lightTextColor]; self.datePicker.layer.cornerRadius = 10; This successfully puts a background behind the UIDatePicker ( which in iOS7 is essentially transparent ) but fails to make the rounded corners for the background that I am looking for ( I do this same thing for an image on the screen and it works perfectly ). It seems that the corner radius doesn't affect

Setting corner radius on UIDatePicker with a background color

不羁的心 提交于 2020-01-14 22:54:03
问题 I have a UIDatePicker in my view and have set the background color of the UIDatePicker : self.datePicker.backgroundColor = [UIColor lightTextColor]; self.datePicker.layer.cornerRadius = 10; This successfully puts a background behind the UIDatePicker ( which in iOS7 is essentially transparent ) but fails to make the rounded corners for the background that I am looking for ( I do this same thing for an image on the screen and it works perfectly ). It seems that the corner radius doesn't affect

UISegmentedControl with square corners

陌路散爱 提交于 2020-01-12 03:10:43
问题 I would like to modify UISegmentedControl with a subclass to remove the rounded corners. I can't seem to set the cornerRadius. Making the SegmentedControl wider than the screen (and therefor "chop" off the corners) is not an option since I have 4 or 5 segments and they would then vary in size. Is there a way to do this? Thanks 回答1: You can set the width of the segments (using setWidth:forSegmentAtIndex:) so you can easily make the left and right end segments larger (say 10px larger) than the

Swift Cannot Round the Corners of my UIButton

假装没事ソ 提交于 2019-12-30 13:26:58
问题 I've looked at almost every stackoverflow solution and for some odd reason my button will not round the corners. Can someone check and see what im doing wrong? let goToMapsButton = UIButton(type: .custom) scrollView.addSubview(goToMapsButton) _ = goToMapsButton.anchor(map.bottomAnchor, left: nil, bottom: seperator.topAnchor, right: self.view.rightAnchor, topConstant: 16, leftConstant: 0, bottomConstant: 16, rightConstant: 16, widthConstant: 50, heightConstant: 50) goToMapsButton

UITableView comes to a crawl when adding a UILabel with cornerRadius to each cell

大城市里の小女人 提交于 2019-12-29 05:25:13
问题 I'm adding a UILabel to each cell in my table view. This presents no problem initially. When I round the corners of the UILabel using layer.cornerRadius scrolling the table view grinds to a halt. UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(cell.bounds.origin.x+10 ,5, 30, 30)]; label1.backgroundColor = ([[managedObject valueForKey:@"color"] hasPrefix:@"FFFFFF"]) ? [UIColor blackColor] : color; label1.layer.cornerRadius = 10.0f; [cell addSubview:label1]; 回答1: I've tried this