zoukankan      html  css  js  c++  java
  • iOS 开发笔记-UILable/UIFont/UIButton常见设置

    UILabel的常见设置

    @property(nonatomic,copy) NSString *text; 显示的文字

    @property(nonatomic,retain) UIFont *font; 字体

    @property(nonatomic,retain) UIColor *textColor; 文字颜色

    @property(nonatomic) NSTextAlignment textAlignment; 对齐模式(比如左对齐、居中对齐、右对齐)

    UIFont的常见设置

    + (UIFont *)systemFontOfSize:(CGFloat)fontSize; 系统默认字体

    + (UIFont *)boldSystemFontOfSize:(CGFloat)fontSize; 粗体

    + (UIFont *)italicSystemFontOfSize:(CGFloat)fontSize; 斜体

    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; 设置按钮的背景图片

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

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

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

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

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

  • 相关阅读:
    LVM 逻辑卷管理
    运维自动化工具 Kickstart
    运维自动化工具 Cobbler
    Python 环境
    Zabbix Agent 自动、主动注册
    Zabbix Proxy 分布式监控
    PHP 性能优化之 PHP-FPM
    PHP 缓存插件之 Zend Opcache ( 取代 APC )
    Alternative PHP Cache ( APC )
    Tomcat ( 单机多 Tomcat 并存 )
  • 原文地址:https://www.cnblogs.com/jys509/p/4761547.html
Copyright © 2011-2022 走看看