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