UIToolbar with rounded corners?

Very simple First of all - have an IBOutlet variable of UIToolbar in your . H file of your view controller. For example interface TextFormattedViewController : UIViewController { IBOutlet UIToolbar *tBar; } Now in your .

M file of your view controller file just place following code & it will work as a magic for you. However- please add comment if any queries import "TextFormattedViewController. H" #import @implementation TextFormattedViewController - (void)viewDidLoad { // following statement is must.TBar.

ClipsToBounds=YES; CALayer *l=tBar. Layer; // set corner radious l setCornerRadius:10; // to apply border on corners l setBorderColor:UIColor redColor CGColor; // to apply set border width. L setBorderWidth:5.0; }.

Very simple. First of all - have an IBOutlet variable of UIToolbar in your . H file of your view controller.

For example. @interface TextFormattedViewController : UIViewController { IBOutlet UIToolbar *tBar; } Now in your . M file of your view controller file just place following code & it will work as a magic for you.

However- please add comment if any queries. #import "TextFormattedViewController. H" #import @implementation TextFormattedViewController - (void)viewDidLoad { // following statement is must.TBar.

ClipsToBounds=YES; CALayer *l=tBar. Layer; // set corner radious l setCornerRadius:10; // to apply border on corners l setBorderColor:UIColor redColor CGColor; // to apply set border width. L setBorderWidth:5.0; }.

Thanks sugar for your great suggestion! For best look we can only change setCornerRadius (and drop the two last calls). It produces nice antialiased round corners.

However all four corners are rounded... – rjobidon Jul 8 '10 at 0:53.

The easiest way to round the corners of a view is with the cornerRadius (and masksToBounds) property of CALayer. However, with that you only have the option of rounding all the corners equally. To use that property, you could put the UIToolbar into another view that was taller than the toolbar, so only the top was rounded.

This would work well if another view will have rounded bottom corners. The easiest way to mask a view to an arbitrary shape is to set the mask property of CALayer to a new CAShapeLayer. In your case, build a CGPath for the CAShapeLayer using CGPathAddLineToPoint and CGPathAddArcToPoint or similar to get only the top corners rounded.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions