uiscrollview

UIScrollView layoutSubviews behavior changes in iOS 5?

自作多情 提交于 2019-12-24 01:23:48
问题 I'm working on a component that is a subclass from UIView and contains a UIScrollView. When scrolling, I noticed different behaviors depending on which SDK I build with. On iOS 4 the layoutSubviews message is send on the scroll view's superview (which is my component) but on iOS 5 it seems that the message is not send anymore... After taking a look at the iOS 5 release notes and changelog, I did not find any mention of such a change. Did I miss somethin? 回答1: In iOS5, layoutSubviews is not

UIScrollView blocks all touches while zooming or scrolling

谁说胖子不能爱 提交于 2019-12-24 01:18:45
问题 I can't press any other buttons in the same window while UIScrollView is zooming with a pinch gesture or scrolling. Is there any way to enable this behavior? It's exactly like the scroll view has exclusive touch (though I tried setting it explicitly to NO ). I have a scroll view inside a view, and I would like it to scroll only while the user holds a scroll button. Otherwise, panning with one finger enables freehand drawing. 回答1: As noted in the comments, the answer was that I foolishly had a

UIScrollView setContentOffset: animated: not working

佐手、 提交于 2019-12-24 01:01:57
问题 I have a problem with two infinite UIScrollViews which do not change their offsets properly. An item in the first UIScrollView corresponds with another one in the second. Then, I want to put the clicked item in the second place and animate the change in both UIScrollView. To get this done properly, I use this two methods: When item is clicked: - (void)click:(id)sender { NSInteger index = [[self cells] indexOfObject:sender]; if (index == 1) { CategoriesViewController *viewController = [

UIViewController resizing itself between viewWillAppear and viewDidAppear?

本小妞迷上赌 提交于 2019-12-24 00:55:17
问题 I've got a really strange bug in my project. I've got a UIScrollView as my main, big view. Inside of it, I have a UIViewController (not UITableViewController ) which has a UITableView instance variable, as well as some miscellaneous UIButtons . I have set the view controller's view frame to CGRectMake(0, 64, 320, 388) , as I have a tab bar above it (this is not functional yet). At first it works great and looks great, but once I present and dismiss a modalViewController (thus reloading the

Creating UIScrollView Programmatically

可紊 提交于 2019-12-24 00:54:10
问题 I am trying to create a UIScrollView programatically. I set a property and synthesize it. @property (weak, nonatomic) IBOutlet UIScrollView *topScrollView; @synthesize topScrollView; I then have a method that does this. [topScrollView setFrame:CGRectMake(320, 0, 320, 65)]; [topScrollView setContentSize:CGSizeMake(500, 100)]; [topScrollView setBackgroundColor:[UIColor greenColor]]; [topScrollView setScrollEnabled:YES]; [topScrollView setShowsHorizontalScrollIndicator:YES]; [topScrollView

Image In Scroll View

寵の児 提交于 2019-12-23 22:13:58
问题 I am using the following code to try and display an image in a UIScrollView. [self.jarView addSubview:imgView]; It does not work. However, it works when I add the subview to my normal view. My UIScrollView is called jarView and imgView is a UIImageView. Thanks 回答1: This works fine for me: UIScrollView *scrollview; scrollview= [[UIScrollView alloc] initWithFrame:CGRectMake(,,,)];// set scroll view size view = [[UIView alloc] initWithFrame:CGRectMake(y1,x1,y2,x2)]; //set the view size UIImage

UIScrollview with Auto-Layout

那年仲夏 提交于 2019-12-23 21:43:43
问题 I'm struggling with UIScrollView for a while now. "descriptionLabel" and "genresLabel" will increase height during runtime and the gap to actors will increase. So i need the scrolling functionality here to see the actors label. I set the height of the contentView as a height-constraint equal to View with priority 250 and hoped that the height will increase automatically if needed. In fact nothing happens and no scrolling is possible. How can i automatically increase the contentView height in

contentOffset is reset on ScrollView header when vertical scrolling in UITableView

江枫思渺然 提交于 2019-12-23 20:21:57
问题 Im making use of this code to align a load of truckDayScrollViews (Subclass of UIScrollView) horizontally in a UITableView, SUDaysForTruckView is just a custom UILabel -(void)scrollViewDidScroll:(UIScrollView *)scrollView { if ([scrollView isKindOfClass:[SUDaysForTruckView class]]) { CGPoint offset=CGPointMake(scrollView.contentOffset.x, 0); for (TruckViewCell *cell in self.tableView.visibleCells) { cell.truckDayScrollView.contentOffset=offset; } self.headerView.contentOffset=offset; self

iOS - Horizontal UIScrollView with multiple UITableViews

若如初见. 提交于 2019-12-23 20:01:14
问题 UIScrollView scrolls Horizontally and UITableView scrolls vertically inside that but unable to load different data when scroll horizontally. have one scrollview which scrolls horizontally on screen and inside of that i have added multiple tableview and want to display different different datas on tableview when swipe. i have tried this but with no luck :( NSArray *arr1 = [[NSArray alloc] initWithObjects:@"1",@"2",@"3", nil]; NSArray *arr2 = [[NSArray alloc] initWithObjects:@"4",@"5",@"6", nil

How to add a view on top of UITableView that scrolls together, but stick to top after scrolling

本秂侑毒 提交于 2019-12-23 19:25:30
问题 I have a UIView with height of 100 pixels that's on top of my UITableView. When I scroll up I want the UIView to scroll together with my UITableView as if it's part it. When 50 pixels of my UIView is hidden from scrolling up, I want to pin the UIView at the top while I continue scrolling up. How can this be achieved? I tried using changing my UIView's top NSLayoutConstraint constant equal to my tableview's content offset, but they don't scroll at the same speed. 回答1: First make sure your