0

I have a UITextView that i use for typing some text (i have added it with Interface builder)

i have made the height 3 font lines high (so in my case the frame height is 47) so i can have 3 lines of text

what i want it to do is type until line3 and the go up if i goto line 4 but what it does is whenever i type enter it automatically goes up so i'm constantly typing at the top of my uitextview

ive put a capture online that show it more cleary .. even when i click a line it goes to the top!

Click here for the screen capture

Louis Gerbarg
  • 43,356
  • 8
  • 80
  • 90
Andy Jacobs
  • 15,187
  • 13
  • 60
  • 91

3 Answers3

1

Write [textview setContentInset:UIEdgeInsetsZero] in textviewbeginediting delegate method or either at the ViewDidLoad method

Hope this will help you.....

IronManGill
  • 7,222
  • 2
  • 31
  • 52
Birju
  • 1,132
  • 11
  • 32
0

I struggled with this for weeks and finally found out that all I had to do was to set the UITextView height to double (or whatever you want), set its background color to ClearColor and you are all set. You just have to play with the height and you will get it. In my case the UITextView was in a tablecell..first when I increased the height it started showing on top of the cell below the current cell. Thats when ClearColor did the magic for me.

StackThis
  • 1,262
  • 1
  • 14
  • 23
0

It looks like the trick is to make the font size bigger

txtView.font = [UIFont systemFontOfSize:14];

when i make my font size 2 points bigger it just types normal instead of going up every line.

Andy Jacobs
  • 15,187
  • 13
  • 60
  • 91