Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(int x=0;x<3;x++){
- CGRect rect = CGRectMake(0,20 * x,100,20);
- UIButton *button = [[UIButton alloc] initWithFrame:rect];
- [btnframe addSubview:button];
- .....
- }
- for(int x=0;x<5;x++){
- for(int y=0;y<5;y++){
- UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(x * 100, y * 20, 100, 20)];
- [button setText:[NSString stringWithFormat:@"%d,%d",x,y]];
- [button addTarget:self action:@selector(changeView:) forControlEvents:UIControlEventTouchUpInside];
- [mainView addSubview:button];
- }
- }
Add Comment
Please, Sign In to add comment