您现在的位置: 万盛学电脑网 >> 程序编程 >> 网络编程 >> ios >> 正文

iPhone更改UISwitch上的text

作者:佚名    责任编辑:admin    更新时间:2022-06-22

   更改UISwitch上的text

  为要更改Text的UISwitch建立IB连接:例如mySwitch,在代码中改变文字:

  ((UILabel *)[[[[[[self.mySwitch subviews] lastObject] subviews] objectAtIndex:2] subviews] objectAtIndex:0]).text = @"Foo";

  ((UILabel *)[[[[[[self.mySwitch subviews] lastObject] subviews] objectAtIndex:2] subviews] objectAtIndex:1]).text = @"Bar";

iPhone更改UISwitch上的text 三联