zoukankan      html  css  js  c++  java
  • UIButton

    1. typedef enum {  
    2.     UIButtonTypeCustom = 0,           // no button type   自定义,无风格   
    3.     UIButtonTypeRoundedRect,          // rounded rect, flat white button, like in address card 白色圆角矩形,类似偏好设置表格单元或者地址簿卡片   
    4.     UIButtonTypeDetailDisclosure,//蓝色的披露按钮,可放在任何文字旁   
    5.     UIButtonTypeInfoLight,//微件(widget)使用的小圆圈信息按钮,可以放在任何文字旁   
    6.     UIButtonTypeInfoDark,//白色背景下使用的深色圆圈信息按钮   
    7.     UIButtonTypeContactAdd,//蓝色加号(+)按钮,可以放在任何文字旁   
    8. } UIButtonType;  
    UIButton* btn=[UIButton buttonWithType:UIButtonTypeRoundedRect];
        btn.frame=CGRectMake(100, 100, 100, 50);
        [btn setTitle:@"Normal" forState:UIControlStateNormal];
        
        [btn setTitle:@"Selected" forState:UIControlStateSelected];
        [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [btn setTitleColor:[UIColor blueColor] forState:UIControlStateSelected];
        [btn addTarget:self action:@selector(pressBtn:) forControlEvents:UIControlEventTouchUpInside];
        [btn setImage:[UIImage imageNamed:@"0.jpg"] forState:UIControlStateNormal];
        
        [self.view addSubview:btn];

    adjustsImageWhenHighlighted

    默认情况下,在按钮被禁用时,图像会被画的颜色深一些。要禁用此功能,请将这个属性设置为NO:

    1. btn1.adjustsImageWhenHighlighted = NO;  

    adjustsImageWhenDisabled

    默认情况下,按钮在被禁用时,图像会被画的颜色淡一些。要禁用此功能,请将这个属性设置为NO:

    1. btn1.adjustsImageWhenDisabled = NO;  

    showsTouchWhenHighlighted

    这个
    属性设置为YES,可令按钮在按下时发光。这可以用于信息按钮或者有些重要的按钮:

      1. btn1.showsTouchWhenHighlighted = YES;  
  • 相关阅读:
    虚拟机搭建FISCO BCOS的区块链浏览器
    linux下安装cmake
    Compile error: Cannot find a C++ compiler that supports both C++11 and the specified C++ flags
    Mac安装CMake
    Mac下如何添加User到group中
    Macos 安装md5sum、sha1sum、md5deep、sha1deep
    Support Vector Regression(SVR) 资料
    Python pandas dataframe
    python用pd.read_csv()方法来读取csv文件
    python pandas 交叉表, 透视表
  • 原文地址:https://www.cnblogs.com/shaonian/p/3024326.html
Copyright © 2011-2022 走看看