zoukankan      html  css  js  c++  java
  • UIButton的selected设为TRUE时在按下时显示自己定义的背景图

    在UIButton的selected设为TRUE后。须要在按钮高亮时,显示自己定义的背景图。
    经研究hightLighted和selected这两个状态是能够重叠的,就是button能够同一时候处于selectec和highlighted两个状态下。
    从UIControlState的定义也能够看出:
    typedef NS_OPTIONS(NSUInteger, UIControlState) {
        UIControlStateNormal       = 0,
        UIControlStateHighlighted  = 1 << 0,                  // used when UIControl isHighlighted is set
        UIControlStateDisabled     = 1 << 1,
        UIControlStateSelected     = 1 << 2,                  // flag usable by app (see below)
        UIControlStateApplication  = 0x00FF0000,              // additional flags available for application use
        UIControlStateReserved     = 0xFF000000               // flags reserved for internal framework use
    };


    设置这样的状态重叠情景时的背景图:
     [button setBackgroundImage:[UIImage imageNamed:@"seled_highLight.png"] forState:UIControlStateSelected| UIControlStateHighlighted];
查看全文
  • 相关阅读:
    PHP的垃圾回收机制
    python使用httpHandler处理请求案例
    使用python中urllib.request.Request()来构建ua
    Pillow《转载》
    python数据格式化之pprint
    使用Mechanize实现自动化表单处理
    beautifulSoup《转》
    Python3网络爬虫(四):使用User Agent和代理IP隐藏身份《转》
    python urllib和urllib3包使用
    使用Mechanize实现自动化表单处理
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10610054.html
  • Copyright © 2011-2022 走看看