菜鸟教程小白 发表于 2022-12-11 20:32:51

iphone - 如何从 UIBarButtonItem 中删除样式?


                                            <p><p>在 <a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UIBarButtonItem_Class/Reference/Reference.html" rel="noreferrer noopener nofollow"><code>UIBarButtonItem</code></a> 中使用自定义图形时在 <code>UIToolbar</code> 内,程序会自动将图形变为白色并应用内阴影。如何防止这种自动样式设置并逐字使用我的自定义图形?</p>

<p> <img src="/image/D43Oi.png" alt="screenshot of toolbar"/> </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>这是通常的做法:</p>

<pre><code>UIImage *buttonImage = ;   
UIButton *myButton = ;

;
;

UIBarButtonItem *myBtnItem = [ initWithCustomView:myButton];

;
;
];
;
</code></pre>

<p>如果这没有帮助,能否请您显示用于初始化工具栏和按钮项的代码?</p></p>
                                   
                                                <p style="font-size: 20px;">关于iphone - 如何从 UIBarButtonItem 中删除样式?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/8199781/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/8199781/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: iphone - 如何从 UIBarButtonItem 中删除样式?