UICSwitchの使い方

676 ワード

Link Address:http://blog.sina.com.cn/s/blog_63578 f 140100 w 3 d.html
1.UICSwitchの初期化
  1UISwitch *switchView = [[UISwitch alloc] initWithFrame:CGRectMake(4.0f, 16.0f, 100.0f, 28.0f)]; 
2.UICwitchの初期化状態を設定する
  1switchView.on = YES;// ON  
3.UICSwitch事件の応答
  1[switchView addTarget:self  action:@selector(switchAction:) forControlEvents:UIControlEventValueChanged];-(void)switchアクション:(id)sender

 
  
UICSwitch*switch=(UICwitch*)sender;
)