UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(, , , )];

    NSDictionary *normalTitleAttributes = @{
NSForegroundColorAttributeName: [UIColor blueColor],
NSStrikethroughStyleAttributeName: @(NSUnderlineStyleSingle)
};
NSAttributedString *normalAttributedTitle = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Button", nil) attributes:normalTitleAttributes];
[btn setAttributedTitle:normalAttributedTitle forState:UIControlStateNormal]; // Set the button's title for highlighted state.
NSDictionary *highlightedTitleAttributes = @{
NSForegroundColorAttributeName : [UIColor blueColor],
NSStrikethroughStyleAttributeName: @(NSUnderlineStyleThick)
};
NSAttributedString *highlightedAttributedTitle = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Button", nil) attributes:highlightedTitleAttributes];
[btn setAttributedTitle:highlightedAttributedTitle forState:UIControlStateHighlighted]; [btn addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:btn];

最新文章

  1. 【无私分享:ASP.NET CORE 项目实战(第七章)】文件操作 FileHelper
  2. Lucene.net站内搜索—2、Lucene.Net简介和分词
  3. 算法系列:Reservoir Sampling
  4. 实现jQuery扩展总结
  5. Unity3D ShaderLab 立方体图的反射遮罩
  6. Mac OS X下高速拷贝文件路径
  7. C#调用C++编写的DLL函数, 以及各种类型的参数传递 z
  8. EffectiveC#2--为你的常量选择readonly而不是const
  9. Android应用-包装脚本批量方法
  10. anglarjs概述
  11. Java对象的内存模型(一)
  12. Angular创建路由从主界面跳转到我们的cesium界面
  13. 前向传播算法(Forward propagation)与反向传播算法(Back propagation)
  14. Error response from daemon: --cluster-store and --cluster-advertise daemon configurations are incompatible with swarm mode
  15. Tesseract处理背景渐变的图片
  16. 记录:tf.saved_model 模块的简单使用(TensorFlow 模型存储与恢复)
  17. java操作mongodb(连接池)(转)
  18. 【转】WPF查找子控件和父控件方法
  19. myeclipse 与 webstrom 免解析node_modules 的方法
  20. Hadoop 集群配置记录小结

热门文章

  1. PySpark的DataFrame处理方法
  2. JQuery实现选择特定楼层回复
  3. Phonegap创建项目语法
  4. bazel-编译一个源文件生成可执行程序
  5. oracle中空值null的判断和转换:NVL的用法
  6. SpringMVC请求后台地址URL没有.*的几种实现方式
  7. 16C554在LINUX上的移植(AT91)
  8. Linux系统查看公网IP地址
  9. C/C++中printf和C++中cout的输出格式
  10. (转)android从应用到驱动之—camera(1)---程序调用流程