I have created a tabBar
application, it has two tabs one tableView
with detail items and another simple UIView
with a UILabel
. I added scrollView
to detailViewController
and put all UI items under scrollView
to get scrolling. I connected the scrollView
using outlet
to my detail view and set the following in detailViewController
[scrollView setScrollEnabled:YES];
scrollView.contentSize = CGSizeMake(scrollView.frame.size.width,scrollView.frame.size.height);
However detail view is not scrolling, its screen is locked. why?
For a UIScrollView, you want the frame to be the size you want it to appear on the screen, and the content size to be the size it will be able to scroll through. So, for scrolling to work properly, you must have the content size set to larger than the view's size in one dimension or the other.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.