zoukankan      html  css  js  c++  java
  • IOS中的textattribute对应的key值

    设置title样式 

     

    UINavgationBar提供了titleTextAttributes 属性来简单的设置其title样式,titleTextAttributes是一个NSDictionary类型,包含的固定的属性名称,可以用来设置title的样式,指定的属性keys声明于NSString UIKit Additions Reference扩展中,包括: 

    NSString *const UITextAttributeFont,设置title的文字字体;
    
    
    NSString *const UITextAttributeTextColor,设置title的文字颜色;
    
    
    NSString *const UITextAttributeTextShadowColor,设置titlewz的阴影颜色;
    
    
    NSString *const UITextAttributeTextShadowOffset,设置titlewz阴影的平移量 ;

     

    如,设置title样式为:系统默认bold类型20号红色字体,阴影颜色为白色,右下偏移2像素 

     

    NSDictionary *navTitleArr = [NSDictionary dictionaryWithObjectsAndKeys:
    [UIFont boldSystemFontOfSize:20],UITextAttributeFont,
    [UIColor redColor],UITextAttributeTextColor ,[NSValue valueWithCGSize:CGSizeMake(2.0, 2.0)] , UITextAttributeTextShadowOffset ,
    [UIColor whiteColor] ,UITextAttributeTextShadowColor ,nil];
    [navBar setTitleTextAttributes:navTitleArr];
       
  • 相关阅读:
    node同时验证手机号和座机号
    导入excle到服务器时候删除服务器历史数据
    杂七杂八
    c# 导出表格 api
    c# 导出表格
    element split 将多个单号分隔
    vue 前台传后台
    vue.js 使用时间组件 日期少一天的问题
    layui 文字滚动
    CRT&&EXCRT学习笔记
  • 原文地址:https://www.cnblogs.com/hushuai-ios/p/3669097.html
Copyright © 2011-2022 走看看