这是我的代码,它已经停留了一段时间,但仍然无法让它工作。UIButton没有在UIScrollView中显示
suggestionScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 44, 320, 44)];
UIButton *button = [[UIButton alloc] init];
button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self
action:@selector(aMethod:)
forControlEvents:UIControlEventTouchDown];
[button setTitle:@"Show View" forState:UIControlStateNormal];
button.frame = CGRectMake(0, 44.0, 160.0, 40.0);
[suggestionScrollView addSubview:button];
[suggestionScrollView bringSubviewToFront:button];
[self.view addSubview:suggestionScrollView];
[self.view bringSubviewToFront:suggestionScrollView];
[button release];
您应该始终用平台和/或语言标记问题。 – 2010-09-24 13:35:02
对不起,下次再来。 – 2010-09-24 14:05:13