views:

19

answers:

1

This is my code, been at it for awhile, but still can't get it to work.

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];
A: 

Oops solved, the button frame was larger than the scrollview.

hakewake