iOS-UI-基本控件之UISwitch
来源:互联网 发布:本科毕业论文 知乎 编辑:程序博客网 时间:2024/06/05 00:57
UISwitch(开关,默认为关)
IOS开发中必不可少的基本控件,主要用于只有两种的选择,比如飞行模式等等,本文主要是列出常用的属性及方法(注XCode版本为7.2)
//默认状态
//属性
@property(nullable, nonatomic, strong) UIColor *onTintColor ;//开着的时候控件的颜色
代码:one.onTintColor=[UIColor brownColor];
如图:
@property(null_resettable, nonatomic, strong) UIColor *tintColor ;//感觉像是边框的颜色,并且带有动画,
代码:one.tintColor=[UIColor redColor];
如图:第二张像个动画
@property(nullable, nonatomic, strong) UIColor *thumbTintColor ;// 按钮的颜色
代码:
one.thumbTintColor=[UIColor blueColor];
如图:
@property(nonatomic,getter=isOn) BOOL on;//是否处于开启状态,默认为NO
//方法
- (instancetype)initWithFrame:(CGRect)frame ; // 设置控件的大小和起始位置
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder ;//从XIB加载
- (void)setOn:(BOOL)on animated:(BOOL)animated; // 开的时候是否有动画
- iOS-UI-基本控件之UISwitch
- iOS-UI-基本控件之UISwitch
- ios基本控件之UISwitch
- 【iOS 开发】基本 UI 控件详解 (UIButton | UITextField | UITextView | UISwitch)
- iOS 控件之 UISwitch
- IOS之基本UI控件
- IOS之基本UI控件
- 12-常用UI控件之 UISwitch开关
- UI控件之UISwitch(事件监听)
- iOS开发之UISwitch控件的使用
- iOS 入门之UI基本控件
- iOS-UI-基本控件之UITextField
- iOS-UI-基本控件之UIView
- iOS-UI-基本控件之UILabel
- iOS-UI-基本控件之UIButton
- IOS的基本控件的使用-UISwitch控件
- 【IOS 开发】根本 UI 控件详解 (UIButton | UITextField | UITextView | UISwitch)
- iOS 基本UI控件
- android布局实践(二)login界面
- 决定QGraphiciItem图形项自身坐标系统零点的最关键的地方
- Cpp_内联函数
- HDOJ 饭卡
- sqlserver字段添加注释方法
- iOS-UI-基本控件之UISwitch
- zstu 2532 hdu 1466 计算直线的交点数
- erlang趣事四
- MFC函数简单解释(更新至28日凌晨)
- iOS-UI-基本控件之UILabel
- LeetCode 32 - Longest Valid Parentheses
- BZOJ1170: [Balkan2007]Cipher|hash
- 要出发公司笔试题
- POJ 3368 Frequent values (RMQ)