Note that there are some explanatory texts on larger screens.

plurals
  1. POUITabBarItem finishedImageSelected placed offsetting the tab bar
    primarykey
    data
    text
    <p>I'm trying to customize UITabBarItem but I'm having problems with the image's position.</p> <p><img src="https://i.stack.imgur.com/pbZVv.png" alt="enter image description here"></p> <p>The image size is 81px x 49px, the same height as the UITabBar. This is how I set the image:</p> <pre><code> // AppDelegate BlocosController *blocos = [[[BlocosController alloc] initWithManagedObjectContext:moc] autorelease]; UINavigationController *navBlocos = [[[UINavigationController alloc] initWithRootViewController:blocos] autorelease]; tabBarController = [[UITabBarController alloc] initWithManagedObjectContext:moc]; tabBarController.viewControllers = [NSArray arrayWithObjects: navData, navBlocos, navBairro, navAtualizar, nil]; // ... // BlocosController.m - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { self.tabBarItem = [[[UITabBarItem alloc] initWithTitle:TITLE image:nil tag:10] autorelease]; [[self tabBarItem] setFinishedSelectedImage:[UIImage imageNamed:@"tab_bar_blocos_selected"] withFinishedUnselectedImage:[UIImage imageNamed:@"tab_bar_blocos_unselected"]]; } return self; } </code></pre> <p><del>I've search on google and found <a href="http://appledmg.com/tuts/?p=52" rel="nofollow noreferrer">this tutorial</a>, the code uses the same API as I use and works as expected.</del> <em>The code in this article behaves just like mine, but since their background is the same color there's a illusion of it been correctly placed.</em></p> <p>Why is the finishedImageSelected and the unselected are placed unaligned with the tab tab? How to fix it?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload