前言:

  有一些控件无法直接设置文本大小,需要使用方法 setTitleTextAttributes 来设置文本属性

UIFont 字体样式 [UIFont fontWithName~];

iOS- 详解文本属性Attributes - 清澈Saup - 推酷

    UIBarButtonItem *rightBarItem = [[UIBarButtonItem alloc] initWithTitle:@"任务" style:UIBarButtonItemStylePlain target:self action:@selector(clickRightBarItem)];
[rightBarItem setTintColor:[UIColor blackColor]];
[rightBarItem setTitleTextAttributes:@{
//1.设置字体样式:例如黑体,和字体大小
NSFontAttributeName:[UIFont fontWithName:@"Arial-BoldMT" size:],
//2.设置段落样式
NSParagraphStyleAttributeName:[NSParagraphStyle defaultParagraphStyle],
//3.设置文字颜色
NSForegroundColorAttributeName:[UIColor redColor],
//4.设置背景颜色//下划线//空心字//删除线等等
NSBackgroundColorAttributeName:[UIColor greenColor]
}forState:(UIControlStateNormal)];

Attributes:文本属性 和NSAttributedString的更多相关文章

  1. 给iOS开发新手送点福利,简述文本属性Attributes的用法

    给iOS开发新手送点福利,简述文本属性Attributes的用法   文本属性Attributes 1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSF ...

  2. IOS开发UI基础文本属性Attributes

    文本属性Attributes 1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont systemFo ...

  3. iOS- 详解文本属性Attributes(转)

    iOS- 详解文本属性Attributes 1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont s ...

  4. zencart批量插入TEXT文本属性attributes

    有时候上传的产品与多级分类比较多,在后台添加文本属性如Name,Number等需要顾客自定义的内容就比较费神了.现在只需将以下代码保存为insert_attributes.php,变量$options ...

  5. UIlabel - 富文本属性

    1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont systemFontOfSize:_fontS ...

  6. 【C语言】控制台窗口图形界面编程(一)句柄和文本属性

    目录 00. 目录 01. 句柄 02. GetStdHandle函数 03. CloseHandle函数 04. SetConsoleTextAttribute函数 05. 十进制颜色对照表 06. ...

  7. css文本属性

    CSS1&2中的文本属性 属性 版本 简介 text-indent CSS1 检索或设置对象中的文本的缩进 letter-spacing CSS1 检索或设置对象中的文字之间的间隔 word- ...

  8. CSS中的文本属性

    本文总结一下CSS中关于文字的相关属性,最后给出实例. CSS基础文字属性 文字的基础属性主要包括:字体.颜色和文本.除去颜色color的属性外,字体和文本的相关属性可以权威参考: CSS 文本属性( ...

  9. Web前端新人笔记之文本属性

    前一段时间因工作时间减缓了更新笔记的时间.我也不知道有没有会观看并且能不能帮到一些初学者,这只是我的一些小随笔而已.当然我也希望的的每一篇随笔都可以帮到更多的想要学习前端开发的初学者们,更希望你们也可 ...

随机推荐

  1. a+=b 是什么意思?

    a+=b或者-=,*=等等就是相当于a=a+b;简写而已,没什么特殊含义此外还有a++/a--相当于a=a+1/a=a-1

  2. 慕客网laravel学习笔记

    session中set方法使用 Session::set('user.username.age','18')嵌套使用得出$user = ['username'=>['age'=>18]]; ...

  3. 用WinDbg调试Windows和驱动程序

    由于本人能力有限,翻译不足之处敬请谅解,欢迎批评指正:sunylat@163.com MSDN原文:https://msdn.microsoft.com/zh-cn/library/windows/h ...

  4. Redirecting Console.WriteLine() to Textbox

    I'm building this application in Visual Studio 2010 using C#. Basically there are 2 files, form1.cs ...

  5. 60. Insert Interval && Merge Intervals

    Insert Interval Given a set of non-overlapping intervals, insert a new interval into the intervals ( ...

  6. Codeforces Round #229 (Div. 2) D

    D. Inna and Sweet Matrix time limit per test 1 second memory limit per test 256 megabytes input stan ...

  7. Functional testing - python, selenium and django

    Functional testing  - python selenium django - Source Code : from selenium import webdriverfrom sele ...

  8. jface的CheckboxTreeViewer实现单选

    需求:使用FilteredTree实现一个下面这样的Dialog,要求Check框单选,即只能选择一个:当选择新的时候,旧的不选.说明:FilteredTree自带一个文本输入框. 1.自己的类继承o ...

  9. NK3C程序配置

    1.坐席软电话 1)NKZXAgent 1)需要环境:.netframework 4.0 2)reg.bat 注册:(确认注册成功) 3)TestAgt.exe 软电话签入测试 LoadConfig: ...

  10. weed-fs 基础测试

    =================== 启动 master 端口:9333 =================== sunsl@test-server:~$ weed master I0102 15: ...