<bdo id='YkcpA'></bdo><ul id='YkcpA'></ul>
<tfoot id='YkcpA'></tfoot>

  • <legend id='YkcpA'><style id='YkcpA'><dir id='YkcpA'><q id='YkcpA'></q></dir></style></legend>

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

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

      1. iOS 4 上的 UIToolbar 色调

        时间:2023-10-03
        <legend id='P3y4e'><style id='P3y4e'><dir id='P3y4e'><q id='P3y4e'></q></dir></style></legend>
        • <tfoot id='P3y4e'></tfoot>

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

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

                  本文介绍了iOS 4 上的 UIToolbar 色调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  刚刚在我的 iPhone 3GS 上切换到 iOS 4,我的一些应用程序坏了.

                  just switched to iOS 4 on my iPhone 3GS and some of my apps broke.

                  我遇到的一个问题是我有一个带有一些按钮的 UIToolbar,颜色为粉红色,在 3.1.3 操作系统上运行良好.升级到 iOS 4 后,工具栏仍然是有色的,但它包含的按钮不再受色调的影响.工具栏为粉红色,而按钮为常规蓝色.

                  One issue I had is that I had a UIToolbar with some buttons, tinted to pink, that worked well on the 3.1.3 OS. After upgrading to iOS 4, the toolbar was still tinted, but the buttons it contained were no longer affected by the tint. The toolbar was pink while the buttons were regular-blue.

                  在网上四处寻找,但没有找到这样的参考.

                  Looked around for it on the net, but found no reference of such a thing.

                  有人知道这个过程中发生了什么吗?

                  Anyone knows what broke in the process?

                  推荐答案

                  (这里必须坦白——我在发帖之前就知道答案了,只是不知道如何将这些数据加载到 StackOverflow.认为我找到的解决方案很有价值对于其他人,所以想在这里发布.我是新来的,所以请不要严厉批评:))

                  (must be frank here - I knew the answer before posting, just didn't know how to load this data to StackOverflow. Thought the solution I found was valuable for others, so wanted to post it here. I'm new here, so please no harsh critics :) )

                  所以最终问题是由 AFAICT 导致的,即操作系统中的行为变化.

                  So eventually the problem resulted from, AFAICT, a change in behavior in the OS.

                  如前所述,色调代码在升级之前就可以工作,并且是这样编写的:

                  As stated the tint code worked before the upgrade and was written like this:

                  // Toolbar content               
                  NSArray *items=[NSArray arrayWithObjects: ... ]; // PSEUDO CODE HERE
                  [toolbar setItems:items]; 
                  
                  // Add tint
                  toolbar.tintColor = [UIColor colorWithRed:0.83 green:0.43 blue:0.57 alpha:0.5];
                  

                  我需要做的只是颠倒事情的顺序:

                  What I needed to do, was just reverse the order of things:

                  // Add tint
                  toolbar.tintColor = [UIColor colorWithRed:0.83 green:0.43 blue:0.57 alpha:0.5];
                  
                  // Toolbar content               
                  NSArray *items=[NSArray arrayWithObjects: ... ]; // PSEUDO CODE HERE
                  [toolbar setItems:items]; 
                  

                  (如果你在 Interface Builder 中创建了 UIToolbar,你可以在那里改变它的色调,这也适用于按钮).

                  (If you created UIToolbar in Interface Builder, you can change it's tint there, and that applies for the buttons as well).

                  我猜在 iOS 4 之前色调会更新所有按钮,而在 iOS 4 中它不会,并且在添加按钮时,它们会检查现有的色调.但这只是一个猜测.该解决方案无论如何都有效..

                  I guess the tint updated all buttons before iOS 4, while in iOS 4 it doesn't and when adding buttons, they check for existing tint. But this is just a guess. The solution works anyhow..

                  希望这对某人有所帮助,并且我没有违反任何神圣的 SO 规则...

                  Hope this helps someone, and that I didn't violate any sacred SO rules...

                  干杯!

                  这篇关于iOS 4 上的 UIToolbar 色调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在您的应用程序中接收远程控制事件的同时从 iPod 应用程序播放音乐? 下一篇:Interface Builder 中不显示字体

                  相关文章

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

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

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