我正在编写此代码以从循环创建按钮并将它们添加到 UIScrollView 但不知何故它不起作用,请有人帮忙。代码是
scroll = [[UIScrollView alloc]init];
[self createurdulistfordisplay];
for(int i = 1;i<[urdulist count];i++)
{
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setBackgroundImage:[UIImage imageNamed:@"2.png"] forState:UIControlStateNormal];
[button addTarget:self
action:@selector(playurduaudio:)
forControlEvents:UIControlEventTouchDown];
button.frame = CGRectMake(80.0, 210.0 + (30*i), 213.0, 46.0);
[scroll addSubview:button];
}