0

ストーリーボードなしでボタンを使用してビューを切り替える方法を知っている人はいますか?手伝ってくれてありがとう !(:

4

1 に答える 1

0
 [myButton addTarget:self action:@selector(buttonClicked) forControlEvent:UIControlEventTouchUpInside];

次に、セレクター buttonClicked を実装します

-(void) buttonClicked {
    UIView* newView = [[UIView alloc]init] ;
    self.view = newView ;
   } 
于 2012-11-15T21:40:39.053 に答える