Gentle programmers, here for your inspection I present code that creates a scrolling view and populates it with buttons:
UIScrollView * testScroll =
[[UIScrollView alloc]initWithFrame:CGRectMake(10, 20, 80, 90)];
CGFloat y = 0;
for (int i = 0;i<5;i++) {
UIButton *mybut = [[UIButton alloc] initWithFrame:CGRectMake(0, y, 75, 25)];
NSString *title = [NSString stringWithFormat:@"button: %d",i]
[mybut setTitle:title forState:UIControlStateNormal];
[mybut addTarget:self action:@selector(Ok:)
forControlEvents:UIControlEventTouchUpInside];
y = y+35;
}
This is all well and good, for those that like scrolling lists of buttons. However, I wish to have a scrolling list of labels! How might I adjust this code to achieve this, my ultimate goal?