這是我的代碼,它已經停留了一段時間,但仍然無法讓它工作。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