【UIKit-106-1】UISwitch - 基础使用
来源:互联网 发布:淘宝怎么让客服改价 编辑:程序博客网 时间:2024/05/18 11:49
创建
- (instancetype)initWithFrame:(CGRect)frame;
aSwitch = [[UISwitch alloc]initWithFrame:CGRectMake(111, 111, 111, 111)]; // 仅位置有效,大小无效。 [self.view addSubview:aSwitch];
属性
@property(nonatomic, retain) UIColor *onTintColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
@property(nonatomic, retain) UIColor *tintColor NS_AVAILABLE_IOS(6_0);
@property(nonatomic, retain) UIColor *thumbTintColor NS_AVAILABLE_IOS(6_0) UI_APPEARANCE_SELECTOR;
aSwitch.onTintColor = [UIColor redColor]; // 选中底色 aSwitch.tintColor = [UIColor greenColor]; // 本身颜色(没选中时边框颜色) aSwitch.thumbTintColor = [UIColor blueColor]; // 滑块颜色
@property(nonatomic,getter=isOn)BOOL on;
if (aSwitch.isOn) { NSLog(@"1");
开关
- (void)setOn:(BOOL)on animated:(BOOL)animated;
[aSwitch setOn:YES animated:YES];
开关
0 0
- 【UIKit-106-1】UISwitch - 基础使用
- UIKit基础:11.利用UISlider-UISwitch-UIStepper-UIImageView创建美女图片浏览器
- UIKit框架-基础控件Swift版本: 7.UISwitch方法/属性详解
- IOS基础控件 UISwitch swift3.1
- 【UIKit-110-1】#import <UIKit/UITableView.h> 基础创建
- 【UIKit-65-1】#import <UIKit/UINavigationController.h>UINavgationVC基础
- iOS基础一 UISwitch
- UIswitch UISlider(基础篇)
- UISwitch的使用
- UISwitch的详细使用
- UISwitch的使用
- UISwitch的使用
- IOS之UISwitch使用
- UISwitch 的使用详解
- UISwitch的使用
- Objectiv-C UIKit基础 NSLayoutConstraint的使用(VFL实现)
- UIKIT基础控件小结
- UIKit基础控件小结
- [android] apk签名 及 应用程序的“包名”问题
- α测试和β测试
- TEst2
- Android中Intent基本使用
- JavaScript-- prototype原型和原型链详解
- 【UIKit-106-1】UISwitch - 基础使用
- 解决引用Microsoft.Office.Core和Microsoft.Office.Interop.Word 的问题
- 简单word关机忘记保存恢复方法(小白教程)
- UFT的使用
- Timer中schedule和scheduleAtFixedRate的不同
- 黑马程序员--集合(下)
- ALM使用经验
- java正则表达式的验证和使用实例(含SSH)
- 反向shell