user2121458
user2121458

Reputation: 143

How to make single line TextView scroll horizontally only

I have a little TextView with a single line. When the line is full of text, I want this TextView start scrolling horizontally not vertically.

To make a picture of this, it's like in the Apple's mail app when you fill the "To :" field.

I've tried different way but no one worked :/

CGSize size = textView.contentSize;
size.height = CGRectGetHeight(textView.frame);
size.width = 300;
textView.contentSize = size;
textView.alwaysBounceVertical = NO;

Any help would be greatly appreciate, cheers

Upvotes: 1

Views: 1346

Answers (1)

andreag
andreag

Reputation: 881

It seems you are looking for a UITextField which behaves exactly like you described.

Upvotes: 4

Related Questions