Solution:UITextView with Rounded / Colored Border - iPhone | Coding Cluster - using asp.net, c#, mvc 4, iphone, php, ios, javascript, in asp.net mvc 3 & more
 

Solution:UITextView with Rounded / Colored Border - iPhone

Friday

UITextView with rounded border- iPhone:
                                              The following lines of code to add rounded corners and a border color to a UITextView. Fist, you import the QuartzCore like,

#import <QuartzCore/QuartzCore.h>

Then add the following code snippets into your viewdidload method for UITextview rounded/colored border.

Demo:

                  


Code :
yourTextView.layer.borderWidth = 1;
    [yourTextView.layer setBackgroundColor: [[UIColor whiteColor] CGColor]];
    [yourTextView.layer setBorderColor: [[UIColor brownColor] CGColor]];
    [yourTextView.layer setBorderWidth: 1.0];
    [yourTextView.layer setCornerRadius:8.0f];
    [yourTextView.layer setMasksToBounds:YES];
Please share this, if you think this is useful to others. Thanks!. 

0 comments:

Post a Comment

Share your thoughts here...

 
 
 

RECENT POSTS

Boost

 
Blogger Widgets