Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mcnuggets

macrumors newbie
Original poster
Jan 2, 2009
18
0
If I place a text field and click on it... sometimes the keyboard that appears hides the textfield if the UITextField is a little bit on the bottom. Is there a way to fix this?
 

detz

macrumors 65816
Jun 29, 2007
1,051
0
Scroll the view up so it's visible or make sure the textfield is also high enough to not get hidden.
 

mcnuggets

macrumors newbie
Original poster
Jan 2, 2009
18
0
Scroll the view up so it's visible or make sure the textfield is also high enough to not get hidden.

Well moving the textfield higher would be a simple fix. But what if your entire view is filled with textfields (like 8 fields). So basically if I click on the last field... i want the view to automatically scroll up so that my keyboard will not hide the textview.
 

detz

macrumors 65816
Jun 29, 2007
1,051
0
Yeah, add all the textfields to a UIScrollView and if the textfield is far enough down when the user selects it scroll the view up so it's visible and back down they they're done.
 

mcnuggets

macrumors newbie
Original poster
Jan 2, 2009
18
0
Yeah, add all the textfields to a UIScrollView and if the textfield is far enough down when the user selects it scroll the view up so it's visible and back down they they're done.

I created a test app and made the view into a UIScrollView. In that view I added one UIViewText all the way at the bottom to see if I can scroll up. It's still not working. When I click on the Text field... the keyboard is hidding the field. Do i have to hold a keyboard key when I'm scrolling (ex: like the pinch feature on Iphone simulator)?

By the way thanks for answering my questions. If it's not to much to ask, can you create a test app and attach the code?
 

sebgaag

macrumors newbie
Apr 25, 2009
1
0
I'm lazy too

I wish he provided the source code for this :cool: ... but it's good no doubt. I'm trying it now.

Hi, I had the exact same issue and this link helped me out. As you I always enjoy when the source code is attached, I'm too lazy and chances are I won't figure it out by myself :rolleyes:

Anyways this time it worked out fine for me so here's my source code based on: http://cocoawithlove.com/2008/10/sliding-uitextfields-around-to-avoid.html

Hope it will help someone else ;)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.