Guest User

Untitled

a guest
Jan 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. for(int x=0;x<3;x++){
  2. CGRect rect = CGRectMake(0,20 * x,100,20);
  3. UIButton *button = [[UIButton alloc] initWithFrame:rect];
  4. [btnframe addSubview:button];
  5. .....
  6. }
  7.  
  8. for(int x=0;x<5;x++){
  9. for(int y=0;y<5;y++){
  10. UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(x * 100, y * 20, 100, 20)];
  11. [button setText:[NSString stringWithFormat:@"%d,%d",x,y]];
  12. [button addTarget:self action:@selector(changeView:) forControlEvents:UIControlEventTouchUpInside];
  13. [mainView addSubview:button];
  14. }
  15. }
Add Comment
Please, Sign In to add comment