Very simple.
First of all, I have the UIToolbar IBOutlet variable in your .h file of your controller. For example.
@interface TextFormattedViewController : UIViewController { IBOutlet UIToolbar *tBar; }
Now, in your .m file of your view controller file, just put the following code and it will work like magic for you. However, please add a comment if any queries.
#import "TextFormattedViewController.h" #import <QuartzCore/QuartzCore.h> @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]; }
Sagar R. Kothari
source share