<tfoot id='t7SL5'></tfoot>
    <legend id='t7SL5'><style id='t7SL5'><dir id='t7SL5'><q id='t7SL5'></q></dir></style></legend>

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

      • <bdo id='t7SL5'></bdo><ul id='t7SL5'></ul>
      <i id='t7SL5'><tr id='t7SL5'><dt id='t7SL5'><q id='t7SL5'><span id='t7SL5'><b id='t7SL5'><form id='t7SL5'><ins id='t7SL5'></ins><ul id='t7SL5'></ul><sub id='t7SL5'></sub></form><legend id='t7SL5'></legend><bdo id='t7SL5'><pre id='t7SL5'><center id='t7SL5'></center></pre></bdo></b><th id='t7SL5'></th></span></q></dt></tr></i><div id='t7SL5'><tfoot id='t7SL5'></tfoot><dl id='t7SL5'><fieldset id='t7SL5'></fieldset></dl></div>
    1. 你如何在 UIBarItem 中使用 setTitleTextAttributes:forState?

      How do you use setTitleTextAttributes:forState in UIBarItem?(你如何在 UIBarItem 中使用 setTitleTextAttributes:forState?)
      • <i id='txJUs'><tr id='txJUs'><dt id='txJUs'><q id='txJUs'><span id='txJUs'><b id='txJUs'><form id='txJUs'><ins id='txJUs'></ins><ul id='txJUs'></ul><sub id='txJUs'></sub></form><legend id='txJUs'></legend><bdo id='txJUs'><pre id='txJUs'><center id='txJUs'></center></pre></bdo></b><th id='txJUs'></th></span></q></dt></tr></i><div id='txJUs'><tfoot id='txJUs'></tfoot><dl id='txJUs'><fieldset id='txJUs'></fieldset></dl></div>

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

          <tbody id='txJUs'></tbody>
        <tfoot id='txJUs'></tfoot>
          • <bdo id='txJUs'></bdo><ul id='txJUs'></ul>
            <legend id='txJUs'><style id='txJUs'><dir id='txJUs'><q id='txJUs'></q></dir></style></legend>

                本文介绍了你如何在 UIBarItem 中使用 setTitleTextAttributes:forState?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                iOSUIBarItem中的setTitleTextAttributes:forState:如何使用?

                你如何设置NSDictionary?无法使其工作,文档对此也不是很清楚.

                How do you set the NSDictionary? Can't make it work and documentation isn't very clear about that.

                来自文档:

                setTitleTextAttributes:forState:
                

                为给定的控件状态设置标题的文本属性:

                - (void)setTitleTextAttributes:(NSDictionary *)attributes 
                                      forState:(UIControlState)state
                

                参数:

                attributes:包含文本属性键值对的字典.您可以使用 NSString UIKit Additions Reference 中列出的键指定字体、文本颜色、文本阴影颜色和文本阴影偏移量.

                attributes: A dictionary containing key-value pairs for text attributes. You can specify the font, text color, text shadow color, and text shadow offset using the keys listed in NSString UIKit Additions Reference.

                state:要为其设置标题文本属性的控件状态.

                state: The control state for which you want to set the text attributes for the title.

                推荐答案

                示例代码:

                [[UIBarItem appearance] setTitleTextAttributes:
                [NSDictionary dictionaryWithObjectsAndKeys:
                [UIColor colorWithRed:220.0/255.0 green:104.0/255.0 blue:1.0/255.0 alpha:1.0], UITextAttributeTextColor, 
                [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0], UITextAttributeTextShadowColor, 
                [NSValue valueWithUIOffset:UIOffsetMake(0, 1)], UITextAttributeTextShadowOffset, 
                [UIFont fontWithName:@"AmericanTypewriter" size:0.0], UITextAttributeFont, nil] 
                forState:UIControlStateNormal];
                

                这篇关于你如何在 UIBarItem 中使用 setTitleTextAttributes:forState?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                ViewController in UINavigationController orientation change(UINavigationController 中的 ViewController 方向更改)
                How to add a navigation controller programmatically in code but not as initial view controller(如何在代码中以编程方式添加导航控制器,但不作为初始视图控制器)
                The correct way to set a light status bar text color in iOS 7 based on different ViewControllers(iOS 7中基于不同ViewControllers设置灯光状态栏文字颜色的正确方法)
                View being blocked by UITransitionView after being presented(呈现后被 UITransitionView 阻止的视图)
                presentViewController not supporting orientation in iOS 6(presentViewController 在 iOS 6 中不支持方向)
                Navigate Back to previous view controller(导航回上一个视图控制器)
                    <tbody id='97AJQ'></tbody>

                      <small id='97AJQ'></small><noframes id='97AJQ'>

                    1. <legend id='97AJQ'><style id='97AJQ'><dir id='97AJQ'><q id='97AJQ'></q></dir></style></legend>

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