我正在使用Xamarin构建iOS应用程序.我环顾四周但却找不到确定UISwitch状态的方法.
我使用Storyboard创建了UI.交换机的Action名称是"Switch"
在我的FirstViewController中
partial void Switch(NSObject sender)
{
// I am trying to find the state of the switch
// here and then do something depending on its state
}
Run Code Online (Sandbox Code Playgroud)
我试过去找发件人
string S=sender.ToString();
Run Code Online (Sandbox Code Playgroud)
我明白了:
S="<UISwitch: 0x14653dc0; frame = (61 425; 51 31); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x14653ea0>>"
Run Code Online (Sandbox Code Playgroud)
我还在Apple开发者网站上看到应该有一个isOn我可以检查但是无法弄清楚如何获得它.
干杯!
| 归档时间: |
|
| 查看次数: |
3629 次 |
| 最近记录: |