【发布时间】:2012-02-04 08:05:04
【问题描述】:
我创建了一个自定义 UIView 类并尝试以编程方式在其中设置一个 UISwitch 控制器。 UISwitch 不会出现。邪恶在哪里?
UIView 类:
- (void)viewWillAppear:(BOOL)animated
{
uiSwitch=[[[UISwitch alloc]initWithFrame:CGRectMake(5.00,200.00,79,27)] autorelease];
[uiSwitch addTarget:self action:@selector(uiSwitchCurrentStatus) forControlEvents:UIControlEventValueChanged];
[self addSubview:uiSwitch];
}
我已经检查了有关 UIswitch 的其他问题,但所有这些问题似乎都不是我的情况。提前谢谢你。
【问题讨论】:
标签: ios cocoa-touch uiswitch