为了这个问题的答案,我已经查看了整个堆栈溢出,我只能找到适用于 4.1 及更低版本的方法,但对于 4.2.1 及更高版本,我找不到获取 ON 文本的新方法和 OFF 进行更改。有没有办法改变它说是和否。这就是我目前所拥有的:
UISwitch *switchControl = [[UISwitch alloc] initWithFrame:frame];
[switchControl addTarget:self action:action forControlEvents:UIControlEventValueChanged];
switchControl.backgroundColor = [UIColor clearColor];
switchControl.on = value;
[cell addSubview:switchControl];
[switchControl release];
更改 UISwitch 文本的最简单方法是什么?或者如果我要制作两个图像并使用动画使它们流动起来会更容易,就像它是一个普通的 UISwitch 一样。