Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplaying images in UITabBarController - UPDATED
    primarykey
    data
    text
    <p>I am trying to put an image in my UI. the <code>Controllers</code> present as the UITabBarItem are <code>UINavigationControllers</code>. When i am trying to put images, on them, the result is not looking good. I am getting only half images, and the images show no color.</p> <p><img src="https://i.stack.imgur.com/WRxwZ.png" alt="enter image description here"></p> <p>the 3 images that i have used are .png images having dimensions 50X50.</p> <p>here is the code that i have used</p> <pre><code>self.custCareVC = [[CustomerCareViewController alloc] initWithNibName:@"CustomerCareViewController_iPhone" bundle:NULL]; self.POController = [[PurchaeOrderViewController alloc] initWithNibName:@"PurchaeOrderViewController_iPhone" bundle:NULL]; self.accAndContactsController = [[AccountsAndContactsViewController alloc] initWithNibName:@"AccountsAndContactsViewController_iPhone" bundle:NULL]; self.customerCareNavController = [[UINavigationController alloc] initWithRootViewController:self.custCareVC]; self.customerCareNavController.title = @"Customer Service"; self.purchaseOrderNavController = [[UINavigationController alloc] initWithRootViewController:self.POController]; self.purchaseOrderNavController.title = @"PO"; self.accAndContactsNavController = [[UINavigationController alloc] initWithRootViewController:self.accAndContactsController]; self.accAndContactsNavController.title = @"Accounts And Contacts"; self.tabBarController = [[UITabBarController alloc] init]; self.tabBarController.viewControllers = [NSArray arrayWithObjects:self.customerCareNavController, self.accAndContactsNavController, self.purchaseOrderNavController, nil]; UIImage *selectedImage0 = [UIImage imageNamed:@"cust_serv_bw_selected.png"]; UIImage *unselectedImage0 = [UIImage imageNamed:@"cust_serv_bw.png"]; UIImage *selectedImage1 = [UIImage imageNamed:@"contacts_bw_selected.png"]; UIImage *unselectedImage1 = [UIImage imageNamed:@"contacts_bw.png"]; UIImage *selectedImage2 = [UIImage imageNamed:@"po_bw_selected.png"]; UIImage *unselectedImage2 = [UIImage imageNamed:@"po_bw.png"]; UITabBar *tabBar = self.tabBarController.tabBar; UITabBarItem *item0 = [tabBar.items objectAtIndex:0]; UITabBarItem *item1 = [tabBar.items objectAtIndex:1]; UITabBarItem *item2 = [tabBar.items objectAtIndex:2]; item0.image = unselectedImage0; item0.selectedImage = selectedImage0; item1.image = unselectedImage1; item1.selectedImage = selectedImage1; item2.image = unselectedImage2; item2.selectedImage = selectedImage2; self.tabBarController.selectedViewController = self.customerCareNavController; </code></pre> <p>How can i correct this. Why is this happening?</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