问题
How can I draw a background behind all my buttons and textfields like on the Foursquare iPhone app? See where it says "Share with..."
回答1:
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.
来源:https://stackoverflow.com/questions/5138996/how-can-i-draw-rounded-rectangles-around-my-textfields-and-buttons-like-foursqua