UISwitch *noticeSwtich = [[UISwitch alloc] initWithFrame:CGRectMake(0, 0, 51, 31)];
// noticeSwtich.layer.cornerRadius = noticeSwtich.height/2;
// noticeSwtich.backgroundColor = RGB(0, 187, 39);
// noticeSwtich.tintColor = RGB(0, 187, 39);//设置关着的时候的颜色
noticeSwtich.onTintColor = RGB(0, 187, 39);//设置开着的时候的颜色
[noticeSwtich addTarget:self action:@selector(noticeSwitchAction:) forControlEvents:UIControlEventValueChanged];
cell.accessoryView = noticeSwtich;

UISwitch的更多相关文章

  1. UI第十节——UISwitch

    - (void)viewDidLoad {    [super viewDidLoad];        // 实例化UISwitch,固定大小    UISwitch *swc = [[UISwit ...

  2. UI中一些不常用的控件UIActivityIndicatorView、UIProgressView、UISegmentedControl、UIStepper、UISwitch、UITextView、UIAlertController

    //UIActivityIndicatorView //小菊花,加载 #import "ActivityIndicatorVC.h" @interface ActivityIndi ...

  3. UILabel UISwitch UISegmentedControl UIAlertView

    基础小控件 /***************************************UIlabel*************************************/ UILabel ...

  4. UISwitch控件的使用

    UISwitch控件的作用是提供一个开关给用户,用户可以选择打开或者关闭. UISwitch的基本属性包括: 1.onTintColor:打开状态下的背景颜色 2.thumbTintColor:滑块的 ...

  5. UIImageView、UISlider、UISwitch、UIStepper、UISegmentControl

    UIImageView——图像视图 作用:专门用来显示图片的控件 . 设置图像 [self.imageView setImage:[UIImage imageNamed:@"abc.png& ...

  6. UISwitch(开关控件)、UISegmentedControl(分段控件)

    一.UISwitch 1.初始化 UISwitch *s1 = [[UISwitch alloc]initWithFrame:CGRectMake(50, 170, 100, 200)];   2.设 ...

  7. IOS开发UI基础UISwitch属性

    UISwitch属性1. onTintColor   处于on时switch 的颜色
    switchImage.onTintColor = [UIColor grayColor];2.tintC ...

  8. 简单认识UISwitch

    以下是常用属性: self.mySwitch.layer.cornerRadius = 15;   // 边框圆角角度 self.mySwitch.layer.borderWidth = 2;  // ...

  9. UISwitch和UIActivity的使用

    - (void)viewDidLoad{    [super viewDidLoad];    //创建一个开关控件,苹果给它固定的size(79*27),frame更改size无效    //继承于 ...

随机推荐

  1. 编译PCL Tutorial文件

    1.PCL Tutorial是使用SPHINX编译而成的. 2.安装Python2.7,从官方网站上下载(Portable Python测试未成功,待研究). 3.安装setuptools,安装成功会 ...

  2. template学习一函数模板

    要点: 1.模板参数在实体化的时候不能自动类型转换,只有非模板函数才可以 例如: int max(int,int); template <class T> T max(T,T); 在调用的 ...

  3. jboss hello world

    http://developers.redhat.com/products/devstudio/get-started/ 1. 下载 Red Hat JBoss Developer studio 2. ...

  4. IQueryable<T> 与 ObjectQuery<T> 差异

    命名空间:System.Data.Objects程序集:  System.Data.Entity(在 System.Data.Entity.dll 中)public class ObjectQuery ...

  5. [Leetcode][JAVA] Binary Tree Level Order Traversal

    Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, ...

  6. 利用GBDT模型构造新特征

    [本文链接:http://www.cnblogs.com/breezedeus/p/4109480.html,转载请注明出处] 我的博客主营地迁至github,欢迎朋友们有空去看看:http://br ...

  7. python 装饰器学习(decorator)

    最近看到有个装饰器的例子,没看懂, #!/usr/bin/python class decorator(object): def __init__(self,f): print "initi ...

  8. NPIO 导出记录

    http://www.cnblogs.com/qingyuan/archive/2012/11/08/2760034.html http://www.cnblogs.com/gaoshuai/arch ...

  9. 【原创】JAVA并发编程——Callable和Future源码初探

    JAVA多线程实现方式主要有三种:继承Thread类.实现Runnable接口.使用ExecutorService.Callable.Future实现有返回结果的多线程.其中前两种方式线程执行完后都没 ...

  10. java-注解

    概念 Annontation是Java5开始引入的新特征.中文名称一般叫注解.它提供了一种安全的类似注释的机制,用来将任何的信息或元数据与程序元素(类.方法.成员变量等)进行关联.更通俗的意思是为程序 ...