zoukankan      html  css  js  c++  java
  • UIButton的基础知识

    摘自:欧阳大神的UI教学视频

    UIButton 的类型

    1、UIButtonTypeRoundedRect 圆角按钮

    2、UIButtonTypeDetailDisclosure 详情按钮

    3、UIButtonTypeContactAdd 加号按钮

    4、UIButtonTypeInfoDark 白色信息按钮

    5、UIButtonTypeInfoLight 灰色信息按钮

    6、 UIButtonTypeCustom 自定义按钮

    UIButton的常用属性

    1、frame 坐标

    2、tag 标签

    3、adjustsImageWhenHighlighted 高亮状态下按钮是否变暗

    4、adjustsImageWhenDisabled 禁用状态下按钮是否变暗

    5、showsTouchWhenHighlighted 按钮高亮状态下是否发光

    UIButton的常用方法

    1、- (void)setTitle:(NSString *)title forState:(UIControlState)state;

    2、- (void)setTitleColor:(UIColor *)color forState:(UIControlState)state;

    3、- (void)setTitleShadowColor:(UIColor *)color forState:forState:(UIControlState)state;

    4、- (void)setImage:(UIImage *)image forState:(UIControlState)state;

    5、- (void)setBackgroundImage:(UIImage *)image forState:(UIControlState)state;

    6、- (void)setTintColor:(UIColor *)color;

    UIButton 的事件

    1、- (void)addTarget:(id)target action:(SEL)action forControlEvent:(UIControlEvents)controlEvents

    2、- (void)removeTarget:(id)target action:(SEL)action forControlEvent:(UIControlEvents)controlEvents

    UIButton修改图片和标题位置

    1、默认情况下从工厂方法中生成的按钮,图片在左边,标题在右边

    2、通过继承UIButton重写方法来设置自己想要的位置

    3、按钮类型需为UIButtonTypeCustom

  • 相关阅读:
    DELPHI IDFTP
    关于网络的一些小知识
    bootstrap弹出框
    GIt的简单使用
    Ubantu搭建虚拟环境
    python中的随机模块random
    python中动态创建类
    关于深浅拷贝的测试
    关于面向对象的属性访问
    多任务的使用模式
  • 原文地址:https://www.cnblogs.com/durwards/p/4509621.html
Copyright © 2011-2022 走看看