I have some problem while using UIScrollView.i create it, set some properties, and use main view to pointer to this UIScrollView.See:
scrollWidth = 320.0;
scrollHeight = 410 * listRegisterPeople.count;
scrollScreenView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, scrollWidth, scrollHeight)];
[scrollScreenView setScrollEnabled:YES];
[scrollScreenView setContentSize:CGSizeMake(scrollWidth, 410 * list.count)];
[scrollScreenView setShowsVerticalScrollIndicator:YES];
[scrollScreenView setShowsHorizontalScrollIndicator:YES];
[scrollScreenView setPagingEnabled:NO];
scrollScreenView.delegate = self;
[scrollScreenView setContentOffset:CGPointMake(0, 0)];
self.view = scrollScreenView;
but i want to add scrollScreenView as subview [self.view addSubview:scrollScreenView]. But with this way i cannot scroll my view i dont know why. . .
how to solve it?
If the frame of ScrollView is bigger or equal than the content size, it wont scroll. Your scrollview height is equal to the scroll view contentSize ,i think that is the problem.
Make the frame equal to self.view and set content size as follows:
Try following.