4

Is there a way to limit UITextView to one line, whereby I can fill it with any amount of text and it will resize horizontally to match: like so:

----------- | cheese | ----------- 

... when filled with longer text becomes

-------------------------- | the last man on earth | -------------------------- 

(the lines indicate the edges of the UITextView)

4
  • UITextField has always been a single line anyway. Commented Aug 3, 2011 at 18:49
  • 2
    Did you mean textView ? textField resize horizontally by default. Commented Aug 3, 2011 at 18:55
  • sorry i meant text view... now changed. Commented Aug 3, 2011 at 19:09
  • ever figure this out? Commented Aug 24, 2013 at 3:45

1 Answer 1

1

this can be achieved by inheriting UITextView class as

@interface InputTextView : UITextView @end @implementation InputTextView /************************************************* * fixes the issue with single lined uitextview *************************************************/ - (UIEdgeInsets) contentInset { return UIEdgeInsetsZero; } @end 

for further reference go-through here

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.