Note that there are some explanatory texts on larger screens.

plurals
  1. POUIScrollView - selection like UIPickerView
    primarykey
    data
    text
    <p><br>I have two little problems with my UIScrollView. <br>I managed to create scroll view, which is similar to the picker view except that it's horizontal.<br> <br><strong>The problem n.1</strong> is - How do I get the number which the user tapped? <br><strong>The problem n.2</strong> is - How do I make the scrollview to go round and round - never-ending? <br><strong>A question</strong> - Is it possible to make some "selection indicator"?</p> <p>Here is my code:</p> <blockquote> <p>numberArray = [NSArray arrayWithObjects:@"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9", @"10", @"11", @"12", @"13", @"14", @"15", @"16", @"17", @"18", @"19", @"20", @"21", @"22", @"23", @"24", @"25", @"26", @"27", @"28", @"29", @"30", @"31", @"32", @"33", @"34", @"35", @"36", @"37", @"38", @"39", @"40", @"41", @"42", @"43", @"44", @"45", @"46", @"47", @"48", @"49", @"50", @"51", @"52", @"53", @"54", @"55", @"56", @"57", @"58", @"59", @"60", @"61", @"62", @"63", @"64", @"65", @"66", @"67", @"68", @"69", @"70", @"71", @"72", @"73", @"74", @"75", @"76", @"77", @"78", @"79", @"80", @"81", @"82", @"83", @"84", @"85", @"86", @"87", @"88", @"89", @"90", @"91", @"92", @"93", @"94", @"95", @"96", @"97", @"98", @"99", @"100", nil];</p> <pre><code>masterDividerView = [[UIView alloc] initWithFrame:CGRectMake(0, 480, 320, 44)]; morePeople = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 53)]; morePeople.backgroundColor = [UIColor scrollViewTexturedBackgroundColor]; morePeople.delegate = self; [morePeople setBackgroundColor:[UIColor whiteColor]]; [morePeople setCanCancelContentTouches:NO]; morePeople.showsHorizontalScrollIndicator = NO; morePeople.showsVerticalScrollIndicator = NO; morePeople.clipsToBounds = NO; morePeople.scrollEnabled = YES; morePeople.pagingEnabled = NO; NSUInteger nimages = 0; NSInteger tot=0; CGFloat cx = 0; for (; ; nimages++) { NSString *label = [numberArray objectAtIndex:nimages]; if (tot==99) { break; } if (99==nimages) { nimages=0; } UILabel *labelView = [[UILabel alloc] init]; labelView.text = label; labelView.lineBreakMode = UILineBreakModeWordWrap; labelView.numberOfLines = 0; [labelView sizeToFit]; labelView.backgroundColor = [UIColor scrollViewTexturedBackgroundColor]; CGRect rect = labelView.frame; rect.size.height = 53; rect.size.width = 40; rect.origin.x = cx; rect.origin.y = 0; labelView.frame = rect; [morePeople addSubview:labelView]; cx += labelView.frame.size.width+5; tot++; } self.pageControl.numberOfPages = nimages; [morePeople setContentSize:CGSizeMake(cx, [morePeople bounds].size.height)]; [masterDividerView addSubview:morePeople]; [self.view addSubview:masterDividerView]; </code></pre> </blockquote> <p>If anybody knows a good solution to this, I would be very happy!!!! :)) <br></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload