I want to use UITextFields
for inputting relatively small amounts of text. The text can be longer than the size of the text field, and I want the user to be able to touch/scroll in开发者_C百科side the text field in order to be able to read all of it.
This type of semi-scroll-like behavior is available in edit mode, but I don't want the user to be able to edit, just scroll. The keyboard shouldn't come up in other words. (I do allow the user to do editing, but that's in another section of the app.)
I'm suspecting that UITextField
wasn't built to do what I'm trying to do and that I should go explore the capabilities of UITextView
instead. Since I've already made a fair investment in providing the infrastructure to support UITextField
editing (when it's needed, just not in the current circumstances), I'm a bit reluctant to abandon UITextFields
altogether.
Does anyone see a way of doing what I want to be able to do?
Howard
y dont u use UITextView instead of textfield with small size
Use a scroll view with the UILabel as the subview of the scroll view?
Alternatively, use a UITextView and set its editable property to NO. If you are worried about the styling of the textview, use the plain style and customized with other UI elements.
精彩评论