1

Possible Duplicate:
Border around UITextView

I want to create a border around the text in a UITextView. I was able to accomplish this by creating 8 separate UITextViews and offsetting them to the 8 pixels around the center text. This looks really nice, but inputting text is severely slowed since the view has to update 9 transparent UITextViews simultaneously every time the user types something!

Is there a cleaner/faster way of accomplishing this? The effect I want is similar to photoshops 'stroke' modifier.

Community
  • 1
  • 1
Parad0x13
  • 2,007
  • 3
  • 23
  • 38

2 Answers2

1

Can you put screenshot of what u mean by border around the text ?

If you want to have the border for UITextView try out following, this should work

#import <QuartzCore/QuartzCore.h>

UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(10, 10, 300, 100)];
    textView.layer.borderColor = [[UIColor redColor] CGColor];
    textView.layer.borderWidth = 2;
D25
  • 283
  • 1
  • 4
  • 17
-1

I'm not sure why my answer was deleted, perhaps because I posted the same solution on an almost identical question? You can find it there: Bordered UITextView

Community
  • 1
  • 1
Ben Packard
  • 26,102
  • 25
  • 102
  • 183
  • your solution is not right for this question. he needs border around the text of textview, not around frame of textview – Imran Ahmed Jul 04 '15 at 07:12