zoukankan      html  css  js  c++  java
  • UISwitch 开关控件 开发笔记

      

     

     switchButoon = [[UISwitchalloc]initWithFrame:CGRectMake(200,20080,40)];

        [switchButoon addTargetself  action:@selector(switchButoonChange:)forControlEvents:UIControlEventValueChanged];

     

        //开关控件外部的颜色

        switchButoon.tintColor = [UIColor  redColor];

     

        //开关控件切换槽 颜色

        switchButoon.onTintColor = [UIColor grayColor];

     

        //开关控件圆按钮按钮

        switchButoon.thumbTintColor = [UIColor  blueColor];

     

      //  In iOS 7, this property has no effect.  在ios7 中无效果

      // this image represents the interior contents of the switch. The image you specify is composited with the switch’s         rounded bezel and thumb to create the final appearance.

        switchButoon.onImage = [UIImageimageNamed:@"swithimage.png"];

        switchButoon.offImage = [UIImageimageNamed:@"swithimage.png"];

        

        

     

     

    #pragma mark--

    #pragma mark -- 开关控件事件

    -(void)switchButoonChange:(id)sender

     

    {

        UISwitch *swithch = (UISwitch *)sender;

        BOOL setting = swithch.isOn;

        [swithch setOn:setting animated:YES];

        if (setting)

        {

            NSLog(@"on");

            

        }else

        {

            NSLog(@"off");

        }

        

     

    }


     

  • 相关阅读:
    LVM逻辑卷管理练习
    浅谈TCP三次握手和四次分手
    centos模拟创建CA和申请证书
    破解root口令
    shell脚本编程进阶总结
    基于FIFO的串口发送机设计
    流水线方式LUT查表法乘法器
    verilog中有符号整数说明及除法实现
    LUT查表法乘法器所犯下错误。。。。
    似然函数
  • 原文地址:https://www.cnblogs.com/DMDD/p/4996859.html
Copyright © 2011-2022 走看看