zoukankan      html  css  js  c++  java
  • UIButton的常见设置

    - (void)setTitle:(NSString *)title forState:(UIControlState)state;
    设置按钮的文字

    - (void)setTitleColor:(UIColor *)color forState:(UIControlState)state;
    设置按钮的文字颜色

    - (void)setImage:(UIImage *)image forState:(UIControlState)state;
    设置按钮内部的小图片

    - (void)setBackgroundImage:(UIImage *)image forState:(UIControlState)state;
    设置按钮的背景图片

    设置按钮的文字字体(需要拿到按钮内部的label来设置)
    btn.titleLabel.font = [UIFont systemFontOfSize:13];

    - (NSString *)titleForState:(UIControlState)state;
    获得按钮的文字

    - (UIColor *)titleColorForState:(UIControlState)state;
    获得按钮的文字颜色

    - (UIImage *)imageForState:(UIControlState)state;
    获得按钮内部的小图片

    - (UIImage *)backgroundImageForState:(UIControlState)state;
    获得按钮的背景图片

  • 相关阅读:
    python time 转换&运算tips
    Web.py session用户认证
    简单的内存池实现gko_alloc
    cpp(第十章)
    cpp(第九章)
    cpp(第八章)
    cpp(第七章)
    cpp(第六章)
    cpp(第五章)
    结构中的位字段
  • 原文地址:https://www.cnblogs.com/xufengyuan/p/6057500.html
Copyright © 2011-2022 走看看