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

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

    2. <tfoot id='zbXM3'></tfoot>

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

        iOS 5 自定义标签栏图像垂直对齐

        时间:2023-05-31

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

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

                  <tbody id='pSFKe'></tbody>
                • <legend id='pSFKe'><style id='pSFKe'><dir id='pSFKe'><q id='pSFKe'></q></dir></style></legend>
                  本文介绍了iOS 5 自定义标签栏图像垂直对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我的自定义标签栏出现了一些奇怪的行为.图像似乎对齐不正确.这是一个截图(我已经删除了我自己的标签栏背景以突出我的问题):

                  I'm getting some odd behaviour with my custom tab bar. The images seem to be aligned incorrectly. Here is a screenshot (I have removed my own tab bar background to highlight my problem):

                  这是我用来为每个状态设置图像的代码:

                  Here is the code I'm using to set the images for each state:

                  self.tabBarController = [[[UITabBarController alloc] init] autorelease];
                  self.tabBarController.viewControllers = [NSArray arrayWithObjects:homeNavController, whatsOnNavController, mapNavController, infoNavController, nil];
                  self.tabBarController.delegate = self;
                  
                  // For iOS 5 only - custom tabs
                  if ([self.tabBarController.tabBar respondsToSelector:@selector(selectedImageTintColor)]) 
                  {
                  
                      // Set the background images
                      //[[UITabBar appearance] setBackgroundImage: [UIImage imageNamed:@"nav_bg.png"]];
                      [[UITabBar appearance] setSelectionIndicatorImage:[UIImage imageNamed:@"nav_over.png"]];
                  
                      [homeNavController.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"nav_home_over"] withFinishedUnselectedImage:[UIImage imageNamed:@"nav_home"]];
                      [whatsOnNavController.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"nav_whats_on_over"] withFinishedUnselectedImage:[UIImage imageNamed:@"nav_whats_on"]];
                      [mapNavController.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"nav_map_over"] withFinishedUnselectedImage:[UIImage imageNamed:@"nav_map"]];
                      [infoNavController.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"nav_info_over"] withFinishedUnselectedImage:[UIImage imageNamed:@"nav_info"]];
                  
                  }
                  

                  我的所有替换标签图像的大小都正确(非视网膜版本为 49 像素高和 80 像素宽).

                  All of my replacement tab images are correctly sized (49 pixels high and 80 pixels wide for the non-retina versions).

                  什么可能导致这种奇怪的行为?

                  What could be causing this odd behaviour?

                  这是一个更新的屏幕截图,背景已经到位:

                  Here is an updated screenshot with the background in place:

                  推荐答案

                  事实证明,您应该始终在 tabitem 中包含文本.该空间是由空白文本创建的.

                  It turns out that you should always have text inside a tabitem. The space was created by blank text.

                  这篇关于iOS 5 自定义标签栏图像垂直对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Xcode 版本 4.6.2 (4H1003) 编译器错误 下一篇:带有框架、图标和图像的自定义 MKAnnotationView

                  相关文章

                  最新文章

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

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

                    <tfoot id='YPEBZ'></tfoot>
                    • <bdo id='YPEBZ'></bdo><ul id='YPEBZ'></ul>

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