UIScrollView question
UIScrollView question
- Subject: UIScrollView question
- From: Luther Baker <email@hidden>
- Date: Sat, 26 Jul 2014 22:58:12 -0500
I have a pretty good frames based background but I'd like to consider an
iPhone screen done with AutoLayout on a UIScrollView such that the bottom
UITextView grows vertically to fill the vertical space remaining from the
text view to the bottom of the device.
---- UIScrollView parent ----
[Label]
[TextField]
[Label]
[TextView]
------------
So basically, without calculating and then setting the height explicitly,
how should the TextView be directed to vertically grow to fill the lower,
visible part UIScrollView?
Extra Credit: When the user taps into the UITextView, the
- keyboard comes up (free)
- the scroll view offset programmatically scrolls up = keyboard height
(keyboard notifications)
- the text view grows/shrinks to perfectly fill the area between the
keyboard top and the navigationbar bottom - remember, this has to work on
iPhone4 and 5.
I'm not sure how to manage that last step without digging in and
getting/setting some direct frame calculations which leads me to wonder if,
in this case, using AutoLayout would be like pushing a square peg into a
round hole.
Thanks in advance for any input,
-Luther
If it isn't already clear, the scroll view isn't really a key player until
the user actually taps into the text view in which case it simply tries to
bring the text view into focus while still allowing someone to, while in
the focus state, either scroll back up to the top text field and enter text
there or scroll to simply resign any existing focus.
"Better" ideas ... or different perspectives are welcome. I could imagine
affine changes or gesture recognizer based solutions for this effect before
but was thinking that leveraging the scroll view would be a natural.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden