How to make a UIView Scrollable?

為{幸葍}努か 提交于 2019-12-08 18:10:31

You need to embed your UIView into a UIScrollView and then change the size of the UIScrollView when the keyboard pops up.

Just give the view a new transform that moves it up. Eg.

[myView setTransform:CGAffineTransformMakeTranslation(0, -keyboardSize.height)];

Thats also animatable, just give it the same animation values as the keyboards and it will look perfect.

This solution is from XCode 5, iOS 7.0 and Storyboards. It worked for me quite well.

http://www.youtube.com/watch?v=4oCWxHLBQ-A

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!