mono touch中UISwitch控件的使用
来源:互联网 发布:数据库 王珊 答案 编辑:程序博客网 时间:2024/06/12 01:02
有不明白的地方欢迎入群 347636249 探讨
using System;//using MonoTouch.UIKit;using MonoTouch.Foundation;using System.Drawing;namespace GCForum{public class MyTestVC :UIViewController{public MyTestVC (){}private UISwitch _switch;public override void ViewDidLoad (){base.ViewDidLoad ();this.View.BackgroundColor = UIColor.White;UILabel lbl = xxxx.ControlCenter.CreateLbl (new RectangleF (10, 100, 100, 20), "");this.View.Add (lbl);_switch = new UISwitch {BackgroundColor = UIColor.Red,Frame = new RectangleF (new PointF(10,10),SizeF.Empty)};_switch.SetState (true, false); //默认设置on选项_switch.ValueChanged += delegate {lbl.Text=_switch.On.ToString();};this.View.Add (_switch);}//...}}
关键是ValueChanged方法,另外,虽然说UISwitch是继承于UIControl,但它的大小是固定的,你即便设置了它的大小,显示不会有变化。
0 0
- mono touch中UISwitch控件的使用
- mono touch中UISegmentedControl控件的使用
- mono touch中,UISlider控件的使用
- mono touch中UIProgressView的使用
- UIActivityIndicatorView及mono touch中线程的使用
- mono touch 中图片的StretchableImage属性
- swift中UISwitch的使用
- swift中UISwitch的使用
- iOS开发之UISwitch控件的使用
- mono touch 中使用多个视图和控制器
- mono touch中自定义事件
- mono touch中touch触发对象判断
- IOS的基本控件的使用-UISwitch控件
- mono touch中去掉NavigationBar的底部阴影
- mono touch中viewcontroller载入过程常见的事件顺序
- mono touch中WebView与html之间的交互
- UI控件详解04-UISwitch的详细使用
- UISwitch的使用
- Centos 6.5中安装后不能打开emacs的问题
- 一劳永逸让windows 64位操作系统 禁止强制驱动签名
- 新手驾到
- Java:String和Date、Timestamp之间的转换
- scp用法(linux灰常有用的命令)
- mono touch中UISwitch控件的使用
- 为原生表单控件穿上美丽的外衣
- 动态表单 (一)动态表单的定义
- hibernate中Sessiong接口中的get load persist 方法使用
- 在Eclipse中使用JUnit4进行单元测试(初级篇)
- ios发布2
- 查看ubuntu下apache2日志
- android上的插件化入门
- android ViewPager和RadioGroup的连接问题