3

I need a textfield so an user could write several lines. Unfortunately a UITextField does not provide several lines, so I think I have to use an UITextView.

But the design of both are not the same.

Is it possible to design the UITextView like the UITextfield standard with white background and rounded corners?

Thanks a lot in advance & Best Regards.

Tim
  • 13,228
  • 36
  • 108
  • 159
  • well Tim thanks for the down vote ;) but this was the best possible way to do this and remeber if you want the shadows you could have used your mind and set the background image of the button as the shadowed image. – Madhup Singh Yadav Dec 30 '09 at 14:09
  • Hey Madhup. I didn't down vote you because I can not do that! I need more than 100 reputations before I can down vote. That was another person, not me! Your idea is good, I tested it, but there are no shadows. So I tried it with a picture, but there were problems with the keyboard, because it is in front of the UITextView and the user can't see his input. – Tim Dec 30 '09 at 15:56
  • Then you need to perform some animations if you want to move your textview up and down with keyboard you should first see http://stackoverflow.com/questions/1887891/what-is-the-reason-the-uikeyboardwillshownotification-called-once/1888253#1888253 also for this – Madhup Singh Yadav Dec 31 '09 at 04:28

3 Answers3

3

In my self appointed role as interface-nazi, I feel compelled to point out that UITextField and UITextView have different appearances to communicate to users to expect a slightly different function.

In a textfield, a return ends editing. In a textview, it may only create a new line. In a textfield, links and phone numbers are not recognized. In a textview they are. Textviews can scroll. And so on...

You shouldn't create a non-standard interface element unless you have a strong compelling reason to do so. You should ask yourself how making a textview look like a textfield will help the user understand what actions they need to take to make the app work as they expect and wish it to.

Surprisingly small tweaks can create serious user confusion. A non-standard interface can introduce just slight pause, a half second, every time they use it. That minor confusion can degrade their perception of the utility of the app.

TechZen
  • 64,370
  • 15
  • 118
  • 145
  • 9
    In my self appointed role as part of the interface-allied forces, I feel compelled to point out that iOS really needs a multiline UITextField. Not having one causes us developers to go hunting for home brewed solutions. I think it'd hardly be non-standard, since and – The WebMacheter Mar 18 '12 at 17:50
1

Thanks to Timur here, you can use this chat input sample to implement a multiple line uitextview like what you see in the iPhone messaging app.

It helped me in my app :)

Here how it looks: chat input sample screenshot

Community
  • 1
  • 1
ozba
  • 6,522
  • 4
  • 33
  • 40
  • What I don't understand is why we have to find something the "works like the messaging app" from a third party when clearly apply has done exactly this already. Why isn't it in the sdk? This should be SO easy to do... – mtmurdock Dec 06 '12 at 21:57
  • This just gave me the idea to just place a UITextField under the UITextVIew. Thanks... – ATOzTOA Oct 31 '14 at 19:11
1

You can put a mask image with rounded borders over your textView. Background of UITextView can be changed by standard setBackgroundColor message.

Morion
  • 10,495
  • 1
  • 24
  • 33