• <bdo id='x78Vx'></bdo><ul id='x78Vx'></ul>

      1. <small id='x78Vx'></small><noframes id='x78Vx'>

        <legend id='x78Vx'><style id='x78Vx'><dir id='x78Vx'><q id='x78Vx'></q></dir></style></legend>

      2. <i id='x78Vx'><tr id='x78Vx'><dt id='x78Vx'><q id='x78Vx'><span id='x78Vx'><b id='x78Vx'><form id='x78Vx'><ins id='x78Vx'></ins><ul id='x78Vx'></ul><sub id='x78Vx'></sub></form><legend id='x78Vx'></legend><bdo id='x78Vx'><pre id='x78Vx'><center id='x78Vx'></center></pre></bdo></b><th id='x78Vx'></th></span></q></dt></tr></i><div id='x78Vx'><tfoot id='x78Vx'></tfoot><dl id='x78Vx'><fieldset id='x78Vx'></fieldset></dl></div>
      3. <tfoot id='x78Vx'></tfoot>
      4. 裁剪的 UIButton 标题

        时间:2023-07-08

        <i id='aAMyi'><tr id='aAMyi'><dt id='aAMyi'><q id='aAMyi'><span id='aAMyi'><b id='aAMyi'><form id='aAMyi'><ins id='aAMyi'></ins><ul id='aAMyi'></ul><sub id='aAMyi'></sub></form><legend id='aAMyi'></legend><bdo id='aAMyi'><pre id='aAMyi'><center id='aAMyi'></center></pre></bdo></b><th id='aAMyi'></th></span></q></dt></tr></i><div id='aAMyi'><tfoot id='aAMyi'></tfoot><dl id='aAMyi'><fieldset id='aAMyi'></fieldset></dl></div>
          <tfoot id='aAMyi'></tfoot>

              <tbody id='aAMyi'></tbody>

              <small id='aAMyi'></small><noframes id='aAMyi'>

                  <bdo id='aAMyi'></bdo><ul id='aAMyi'></ul>
                • <legend id='aAMyi'><style id='aAMyi'><dir id='aAMyi'><q id='aAMyi'></q></dir></style></legend>
                • 本文介绍了裁剪的 UIButton 标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在为 UIButton 的标题使用自定义字体.它可以工作,除非使用这种特殊字体,第一个字符的一部分被剪裁了.例如:

                  I am using a custom font for the title of a UIButton. It works, except with this particular font a portion of the first character is clipped. For example:

                  我尝试设置 contentEdgeInsets 和 titleEdgeInsets ,但似乎无法让它不被剪裁.我还尝试将 button.titleLabel.clipsToBounds 属性设置为 NO;

                  I tried setting the contentEdgeInsets and titleEdgeInsets and can't seem to get it not clipped. I also tried setting the button.titleLabel.clipsToBounds property to NO;

                  任何建议将不胜感激.

                  推荐答案

                  所以我最终将 UIButton 标题设置为 nil,并将我自己的 UILabel 作为子视图添加到 UIButton.我将 UILabel 框架设置为与按钮相同的大小,并将其设置为居中.

                  So I just ended up setting the UIButton title to nil and added my own UILabel as a subview to the UIButton. I set the UILabel frame to the same size as the button and set it to be centered.

                  我确信这不是最优雅的解决方案,但它可以完成工作.

                  Not the most elegant solution I am sure, but it gets the job done.

                  这篇关于裁剪的 UIButton 标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:iPhone UIView 动画禁用 UIButton 子视图 下一篇:如何从同一个故事板访问 Objective-C 和 Swift 类?

                  相关文章

                    • <bdo id='TNCS1'></bdo><ul id='TNCS1'></ul>

                      <i id='TNCS1'><tr id='TNCS1'><dt id='TNCS1'><q id='TNCS1'><span id='TNCS1'><b id='TNCS1'><form id='TNCS1'><ins id='TNCS1'></ins><ul id='TNCS1'></ul><sub id='TNCS1'></sub></form><legend id='TNCS1'></legend><bdo id='TNCS1'><pre id='TNCS1'><center id='TNCS1'></center></pre></bdo></b><th id='TNCS1'></th></span></q></dt></tr></i><div id='TNCS1'><tfoot id='TNCS1'></tfoot><dl id='TNCS1'><fieldset id='TNCS1'></fieldset></dl></div>
                      <legend id='TNCS1'><style id='TNCS1'><dir id='TNCS1'><q id='TNCS1'></q></dir></style></legend><tfoot id='TNCS1'></tfoot>

                      <small id='TNCS1'></small><noframes id='TNCS1'>