iOS中关于UIButton缩进问题
来源:互联网 发布:兰蔻网络推广方案 编辑:程序博客网 时间:2024/04/30 15:06
<p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(97, 34, 174);"><span style="font-variant-ligatures: no-common-ligatures"></span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(201, 27, 19);"></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(201, 27, 19);"><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> </span><span style="font-variant-ligatures: no-common-ligatures; color: #6122ae">NSString</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> *string = </span><span style="font-variant-ligatures: no-common-ligatures">@"</span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">测试</span><span style="font-variant-ligatures: no-common-ligatures">UIButton</span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">文本缩进</span><span style="font-variant-ligatures: no-common-ligatures">"</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000">;</span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"> </span><span style="font-variant-ligatures: no-common-ligatures; color: #6122ae">UIButton</span><span style="font-variant-ligatures: no-common-ligatures"> *button = [[</span><span style="font-variant-ligatures: no-common-ligatures; color: #6122ae">UIButton</span><span style="font-variant-ligatures: no-common-ligatures"> </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81">alloc</span><span style="font-variant-ligatures: no-common-ligatures">] </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81">initWithFrame</span><span style="font-variant-ligatures: no-common-ligatures">:</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81">CGRectMake</span><span style="font-variant-ligatures: no-common-ligatures">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #0435ff">30</span><span style="font-variant-ligatures: no-common-ligatures">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #0435ff">50</span><span style="font-variant-ligatures: no-common-ligatures">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #0435ff">250</span><span style="font-variant-ligatures: no-common-ligatures">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #0435ff">40</span><span style="font-variant-ligatures: no-common-ligatures">)];</span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(61, 29, 129);"><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> [button </span><span style="font-variant-ligatures: no-common-ligatures">setTitleColor</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000">:[</span><span style="font-variant-ligatures: no-common-ligatures; color: #6122ae">UIColor</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> </span><span style="font-variant-ligatures: no-common-ligatures">redColor</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000">] </span><span style="font-variant-ligatures: no-common-ligatures">forState</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000">:</span><span style="font-variant-ligatures: no-common-ligatures">UIControlStateNormal</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000">];</span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(61, 29, 129);"><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> [button </span><span style="font-variant-ligatures: no-common-ligatures">setBackgroundColor</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000">:[</span><span style="font-variant-ligatures: no-common-ligatures; color: #6122ae">UIColor</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> </span><span style="font-variant-ligatures: no-common-ligatures">grayColor</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000">]];</span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(61, 29, 129);"><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> [button </span><span style="font-variant-ligatures: no-common-ligatures">setTitle</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000">:string </span><span style="font-variant-ligatures: no-common-ligatures">forState</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000">:</span><span style="font-variant-ligatures: no-common-ligatures">UIControlStateNormal</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000">];</span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"> [</span><span style="font-variant-ligatures: no-common-ligatures; color: #c32275">self</span><span style="font-variant-ligatures: no-common-ligatures">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa">view</span><span style="font-variant-ligatures: no-common-ligatures"> </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81">addSubview</span><span style="font-variant-ligatures: no-common-ligatures">:button];</span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(29, 148, 33);"><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> </span><span style="font-variant-ligatures: no-common-ligatures">// UIEdgeInsets insets = {top, left, bottom, right};</span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; min-height: 16px;"><span style="font-variant-ligatures: no-common-ligatures"> </span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(29, 148, 33);"><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> </span><span style="font-variant-ligatures: no-common-ligatures">// </span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">文本距从</span><span style="font-variant-ligatures: no-common-ligatures">button</span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">左边</span><span style="font-variant-ligatures: no-common-ligatures">10</span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">个像素的位置开始</span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(29, 148, 33);"><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> </span><span style="font-variant-ligatures: no-common-ligatures">// button.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);</span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; min-height: 16px;"><span style="font-variant-ligatures: no-common-ligatures"> </span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(29, 148, 33);"><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> </span><span style="font-variant-ligatures: no-common-ligatures">// </span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">文本距从</span><span style="font-variant-ligatures: no-common-ligatures">button</span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">上边</span><span style="font-variant-ligatures: no-common-ligatures">10</span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">个像素的位置开始</span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(29, 148, 33);"><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> </span><span style="font-variant-ligatures: no-common-ligatures">// button.titleEdgeInsets = UIEdgeInsetsMake(10, 0, 0, 0);</span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; min-height: 16px;"><span style="font-variant-ligatures: no-common-ligatures"> </span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(29, 148, 33);"><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> </span><span style="font-variant-ligatures: no-common-ligatures">// </span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">文本距从</span><span style="font-variant-ligatures: no-common-ligatures">button</span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">下边</span><span style="font-variant-ligatures: no-common-ligatures">10</span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">个像素的位置开始</span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(29, 148, 33);"><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> </span><span style="font-variant-ligatures: no-common-ligatures">// button.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 10, 0);</span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; min-height: 16px;"><span style="font-variant-ligatures: no-common-ligatures"> </span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(29, 148, 33);"><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> </span><span style="font-variant-ligatures: no-common-ligatures">// </span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">文本距从</span><span style="font-variant-ligatures: no-common-ligatures">button</span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">右边</span><span style="font-variant-ligatures: no-common-ligatures">10</span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">个像素的位置开始</span></p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(29, 148, 33);"><span style="font-variant-ligatures: no-common-ligatures; color: #000000"> </span><span style="font-variant-ligatures: no-common-ligatures">// button.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 10);</span></p>
0 1
- iOS中关于UIButton缩进问题
- IOS中关于UIButton release的问题
- 关于iOS中设置UIButton的标题(含图)左右对齐的问题
- iOS中关于设置UIButton文字和图标对齐格式的问题
- IOS开发之关于UIButton点击没有响应问题
- IOS开发之关于UIButton点击没有响应问题
- 关于源代码中缩进是否使用tab问题的心得
- iOS中UIButton详解
- 关于文本换行缩进问题
- 关于UIButton 在autolayout中应用中的一个问题
- iOS(UIButton使用问题)
- iOS UIButton倒计时闪烁问题
- iOS在UIButton中换行
- iOS中UIButton的block
- iOS中 UIButton和UIImageView
- iOS中UIButton的使用
- ios中UIButton的使用
- 关于vscode编辑器缩进的问题
- Ubuntu上配置Swift的开发环境,基于JetBrains的Clion编辑器
- Objective-C单例设计模式
- AVI Player with Playmaker actions 播放插件浅谈 (一)
- 使用百度地图查询经过某一公交站的所有公交线路
- ProgressBar 颜色的设置
- iOS中关于UIButton缩进问题
- Oracle中由 case when 报错 ORA-12704:字符集不匹配的简易解决
- poi导出excel直接打包的方法
- 基于Activiti5工作流实战企业协同OA办公系统(spring-data-jpa、uur前台组件)
- oj--C++结构体之统计最高最低分
- Android中TextView中设置字体颜色
- 商品秒杀
- 设置 label 的行间距和删除线
- 科目二难点——倒车入库