开发者

How can I draw Rounded Rectangles around my textfields and buttons like Foursquare app

How can I draw a background behind all my buttons and textfields like on the 开发者_C百科Foursquare iPhone app? See where it says "Share with..."


You can achieve rounded corners on any view by changing the cornerRadius property of the view's backing CALayer. To access these properties, you will have to link against the QuartzCore framework.

Then you can change the corner radius like this:

textFieldBackgroundView.layer.cornerRadius = 10;

Just make sure to add <QuartzCore/QuartzCore.h> to your project and #import it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜