rounded-corners

Just two rounded corners? [duplicate]

荒凉一梦 提交于 2019-12-17 05:45:27
问题 This question already has answers here : Rounded UIView using CALayers - only some corners - How? (14 answers) Closed 6 years ago . In my iPad app, I want a second view to appear within the main when the user clicks a button. The new view will be smaller than the first, and darken the background when it is displayed. I want the top two corners of the new view to appear rounded, but using cornerRadius sets all of them rounded. How can I make just two corners rounded? 回答1: You have to do this

Round Top Corners of a UIButton in Swift

筅森魡賤 提交于 2019-12-17 05:01:40
问题 I know I can round all four corners using: myBtn.layer.cornerRadius = 8 myBtn.layer.masksToBounds = true Since I only want to round two, I did some research and found this: extension UIView { func roundCorners(corners:UIRectCorner, radius: CGFloat) { let path = UIBezierPath(roundedRect: self.bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius)) let mask = CAShapeLayer() mask.path = path.CGPath self.layer.mask = mask } } Which is called like this: view

How do I create a round cornered UILabel on the iPhone?

一曲冷凌霜 提交于 2019-12-17 04:12:11
问题 Is there a built in way to create round-cornered UILabels? If the answer is no, how would one go about creating such an object? 回答1: iOS 3.0 and later iPhone OS 3.0 and later supports the cornerRadius property on the CALayer class. Every view has a CALayer instance that you can manipulate. This means you can get rounded corners in one line: view.layer.cornerRadius = 8; You will need to #import <QuartzCore/QuartzCore.h> and link to the QuartzCore framework to get access to CALayer's headers

Round two corners in UIView

随声附和 提交于 2019-12-17 02:18:16
问题 A little while ago I posted a question about rounding just two corners of a view, and got a great response, but am having problems implementing it. Here is my drawRect: method: - (void)drawRect:(CGRect)rect { //[super drawRect:rect]; <------Should I uncomment this? int radius = 5; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextBeginPath(context); CGContextAddArc(context, rect.origin.x + radius, rect.origin.y + rect.size.height - radius, radius, M_PI, M_PI / 2, 1);

Rounded corners in MS IE 7 - on Intranet with no access to the outside world - and no JS/HTC

只谈情不闲聊 提交于 2019-12-14 03:58:28
问题 I got a good answer to my previous question Rounded corners in MS IE 7 ... it was my own stupid fault for forgetting to mention that it is for an intranet which can't access the outside world, and that JS is forbidden, so I can't use HTC. So, here's the question again.. Can I (and, if so, what's the simplest way to) get (scalable) rounded corners in MS IE 7+ using only CSS/HTML ... images are ok, but I worry about the user resizing the browser. A bonus if it's cross-browser, but IE7+ with no

Safari Rendering Rounded Corners Incorrectly

可紊 提交于 2019-12-14 03:05:52
问题 I have a div with rounded corners at the bottom and normal corners at the top. This div also has a border along the top. However this border seems to 'seep through' down to the rounded corners at the bottom. This issue is only present in Safari (I'm using 5.1.3) and not Chrome or Firefox. The CSS related to this bug is: .info { float: left; width: 272px; height: 200px; background: #222222; border-top: 5px solid #6fcbe4; -webkit-border-bottom-right-radius: 18px; -webkit-border-bottom-left

Use Nimbus to give rounded corners for JButton

你。 提交于 2019-12-13 08:48:21
问题 I have created a button using an image: ImageIcon water = new ImageIcon("button.jpeg"); JButton exceptionButton = new JButton(water); I want the button to have rounded corners but I am not able to do that. I have heard about Nimbus. HOw should I use it to get rounded corners for the button with or without image? 回答1: Try this class, it's an easy way using netbeans. /* * NewJFrame.java * * Created on 3 mars 2014, 10:08 */ package GUI; import java.util.logging.Level; import java.util.logging

Is UIBezierPath the best way to make a movable rounded rectangle?

爱⌒轻易说出口 提交于 2019-12-13 07:01:30
问题 I'm making a UISlider from scratch. I started by making a rounded rectangle, which I did using the code below: CGRect frame = CGRectMake(10, 10, self.frame.size.width, 10); UIBezierPath* path = [UIBezierPath bezierPathWithRoundedRect:frame cornerRadius:10.0]; [[UIColor blueColor] setFill]; [path fill]; I saw some other options to make a rounded rectangle but thought this was the quickest way. Are there any limitations with making one using UIBezierPath? Namely, the slider needs to be able to

Which Javascript solution(Not .htc) can really make Antialiased round corner in IE7 and 8?

醉酒当歌 提交于 2019-12-12 20:31:34
问题 Which JavaScript solution (Not .htc ) can really make Anti aliased round corner in IE7 and 8 like CSS3 gives in supported browsers? I tried many http://www.ruzee.com/blog/ruzeeborders/ http://blue-anvil.com/archives/anti-aliased-rounded-corners-with-jquery/ http://www.curvycorners.net/ All are claiming to give anti aliased corner but giving corners like this alt text http://shup.com/Shup/375652/11063104941-My-Desktop.png But no one is giving anti aliased corner. if I need 10px round corner.

Android: button with two background colors

回眸只為那壹抹淺笑 提交于 2019-12-12 10:49:18
问题 I want to make a button style on Android with two background colors, such as the following image: http://i.stack.imgur.com/ExKXl.png Is it possible to make with drawable resources? I´ve being searching for a solution on http://developer.android.com/guide/topics/resources/drawable-resource.html but none of them can have two colors. Is there a way? [editing the answer] The solution was to create a <layer-list> with items and each <item> has one <shape> . The code is bellow (the entire button