ios - UITabBarController 最初突出显示所有标签栏项目图像
<p><p>我正在以编程方式实例化一个 <code>UITabBarController</code>,它将管理 2 个 ViewController ,然后将其设置为 <code>rootViewController</code>。但是,当 View 出现时,它会突出显示所有选项卡项的图像(尽管文本已正确突出显示)。无论我为 <code>selectedIndex</code> 设置什么,图像都会突出显示。只有当您点击标签栏项目时,它才会真正切换图像上的突出显示状态。这是怎么回事?</p>
<p>代码:</p>
<pre><code>UITabBarController *tabController = [ init];
UIStoryboard *storyboard = ;
OGVideoStreamViewController *questionsController = ;
questionsController.isQuestion = YES;
OGVideoStreamViewController *answersController = ;
answersController.isQuestion = NO;
OGMatchesViewController *matchesController = [ initWithNibName:@"OGMatchesViewController" bundle:nil];
questionsController.tabBarItem = [ initWithTitle:@"Questions" image: tag:0];
answersController.tabBarItem = [ initWithTitle:@"Answers" image: tag:1];
matchesController.tabBarItem = [ initWithTitle:@"Inbox" image: tag:2];
animated:NO];
tabController.selectedViewController = questionsController;
[ keyWindow].rootViewController = tabController;
</code></pre>
<p> <img src="/image/MsfZD.png" alt="enter image description here"/> </p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>我也遇到了同样的问题,这是由于我打电话造成的:</p>
<pre><code>.tintColor = [UIColor colorWithRed:1.000
green:0.793
blue:0.236
alpha:1.000];
</code></pre>
<p>我在我的 AppDelegate 中调用了它,所以我可以将其更改为以下内容:</p>
<pre><code>self.window.tintColor = [UIColor colorWithRed:1.000
green:0.793
blue:0.236
alpha:1.000];
</code></pre></p>
<p style="font-size: 20px;">关于ios - UITabBarController 最初突出显示所有标签栏项目图像,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/23861616/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/23861616/
</a>
</p>
页:
[1]