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

  • 相关阅读:
    关于Spring Test 小结
    排他思想---->tab选项卡
    对金额的格式化
    js 对多个id 的封装方法
    form表单数据封装成json格式并提交给服务器
    js技巧专题篇: 页面跳转
    对象流
    线程
    异常处理、常见异常说明
    数据库(概念、语法、DBMS、SQL语言:创建数据库、表格,添加、修改、删除数据记录)
  • 原文地址:https://www.cnblogs.com/durwards/p/4509621.html
Copyright © 2011-2022 走看看