
Hello everyone,
I need help on creating a button like in the above picture.
They are multiple buttons that are used to switch to another view and the next button to show a hidden button.
I ‘d like to know which UI Control to use.
Whichever free ready-to-use control or code example is preferred.
Thank you very much.
I did what Mayur Joshi’s suggestion but don’t understand why I can’t scroll buttons in scrollview and there’s no text on buttons.
This is my code
- (void)viewDidLoad
{
[super viewDidLoad];
[scrollView setContentSize:CGSizeMake(500.0f, 50.0f)];
[self.view addSubview: scrollView];
UIButton *button1 = [UIButton buttonWithType: UIButtonTypeRoundedRect];
[button1 setTitle:@"Button1" forState:UIControlStateNormal];
[button1 setFrame:CGRectMake(0.0F, 0.0F, 100.0F, 50.0F)];
[scrollView addSubview:button1];
[button1 release];
UIButton *button2 = [UIButton buttonWithType: UIButtonTypeRoundedRect];
[button2 setTitle:@"Button2" forState:UIControlStateNormal];
[button2 setFrame:CGRectMake(100.0F, 0.0F, 100.0F, 50.0F)];
[scrollView addSubview:button2];
[button2 release];
UIButton *button3 = [UIButton buttonWithType: UIButtonTypeRoundedRect];
[button3 setTitle:@"Button3" forState:UIControlStateNormal];
[button3 setFrame:CGRectMake(200.0F, 0.0F, 100.0F, 50.0F)];
[scrollView addSubview:button3];
[button3 release];
UIButton *button4 = [UIButton buttonWithType: UIButtonTypeRoundedRect];
[button4 setTitle:@"Button4" forState:UIControlStateNormal];
[button4 setFrame:CGRectMake(300.0F, 0.0F, 100.0F, 50.0F)];
[scrollView addSubview:button4];
[button4 release];
UIButton *button5 = [UIButton buttonWithType: UIButtonTypeRoundedRect];
[button5 setTitle:@"Button5" forState:UIControlStateNormal];
[button5 setFrame:CGRectMake(400.0F, 0.0F, 100.0F, 50.0F)];
[scrollView addSubview:button5];
[button5 release];
}
you can download source code here
This is app screen shot.

Just remove the release methods from the buttons and you are good to go.
Actually, when you declare the buttons with
it is already in auto-release mode as its a class method and not a static method. So you dont need to write