Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 10th, 2012  |  syntax: None  |  size: 0.60 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. UITextView Issue
  2. #import <QuartzCore/QuartzCore.h>
  3.  
  4. ....
  5.  
  6.  
  7. textView.layer.borderWidth = 5.0f;
  8. textView.layer.borderColor = [[UIColor grayColor] CGColor];
  9.        
  10. UITextView* myTextView = [[UITextView alloc] initWithFrame:CGRectMake(0,0,280,180)];
  11. [myTextView setBackgroundColor:[UIColor clearColor]];
  12.        
  13. [[myTextView layer] setCornerRadius:15.0f]; //You don't need to set this but it will give the view rounded corners.
  14. [[myTextView layer] setBorderWidth:1.0f]; //again you pick the value 1 is quite a thin border
  15. [[myTextView layer] setBorderColor:[[UIColor blackColor] CGColor]]; //again you can choose the color.