Note that there are some explanatory texts on larger screens.

plurals
  1. POImage on TabBar Not displaying properly.. shows an extra line on top - UPDATED
    primarykey
    data
    text
    <p>I have added an ImageView as a subview of my TabBar (that has three NavigationControllers). When i tap on any of the tabs of the tabBarController, then the Image on the imageView changes accordingly (the image shows that particular tab selected and others unselected).</p> <p>However, the image always shows an extra line on the tabBar. It looks like it crosses the limit of the tabBar. The dimensions of my image is 320x64 pixels (for non-retina iPhone) and 640x128 pixels (for retina iPhone). </p> <p>Here's how i am declaring instance var for the image view and the tabBarController.</p> <pre><code>@interface HomePageViewController ()&lt;UITabBarControllerDelegate&gt; { UIImageView* tabBarView; UITabBarController *tabBarController; } -(UITabBarController *) configureTheTabBarControllerWithNavControllerAtIndex:(NSInteger)index { UINavigationController *customerCareNavController; UINavigationController *accAndContactsNavController; UINavigationController *purchaseOrderNavController; CustomerCareViewController *custCareVC; PurchaeOrderViewController *POController; AccountsAndContactsViewController *accAndContactsController; custCareVC = [[CustomerCareViewController alloc] initWithNibName:@"CustomerCareViewController_iPhone" bundle:NULL]; POController = [[PurchaeOrderViewController alloc] initWithNibName:@"PurchaeOrderViewController_iPhone" bundle:NULL]; accAndContactsController = [[AccountsAndContactsViewController alloc] initWithNibName:@"AccountsAndContactsViewController_iPhone" bundle:NULL]; customerCareNavController = [[UINavigationController alloc] initWithRootViewController:custCareVC]; purchaseOrderNavController = [[UINavigationController alloc] initWithRootViewController:POController]; accAndContactsNavController = [[UINavigationController alloc] initWithRootViewController:accAndContactsController]; tabBarController = [[UITabBarController alloc] init]; tabBarController.viewControllers = [NSArray arrayWithObjects:customerCareNavController,accAndContactsNavController,purchaseOrderNavController, nil]; switch (index) { case 0: tabBarController.selectedIndex = 0; break; case 1: tabBarController.selectedIndex = 1; break; case 2: tabBarController.selectedIndex = 2; break; } tabBarView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tab_mypeople.png"]]; tabBarView.frame = CGRectMake(0, -15, 320, 64); [tabBarController.tabBar addSubview:tabBarView]; tabBarController.delegate = self; [self selectTabBarIndex:index]; [self presentViewController:tabBarController animated:YES completion:NULL]; return tabBarController; } -(void)tabBarController:(UITabBarController *)TBController didSelectViewController:(UIViewController *)viewController { NSUInteger indexSelected = [[TBController viewControllers] indexOfObject:viewController]; [self selectTabBarIndex:indexSelected]; } - (void) selectTabBarIndex:(NSInteger)index { switch (index) { case 0: tabBarView.image=[UIImage imageNamed:@"tab_myCalendar.png"]; break; case 1: tabBarView.image=[UIImage imageNamed:@"tab_myDetails.png"]; break; case 2: tabBarView.image=[UIImage imageNamed:@"TabBarItem_PO.png"]; break; } } </code></pre> <p>Please see the screenshot..</p> <p><img src="https://i.stack.imgur.com/EtQh2.png" alt="enter image description here"></p> <p>Setting the barStyle as black gives me the following result</p> <p><img src="https://i.stack.imgur.com/NhX14.png" alt="enter image description here"></p> <p>The line has faded a little, but is still visible..</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