Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to control UITabBar
    text
    copied!<p>I've created UITabBar (items: info, location and description) in the middle of the content and now i want to set custom background image for tab bar, default select first button and get action when user select another tab bar item.</p> <p>Here is ss of tab bar: <a href="http://dl.dropbox.com/u/77033905/tabBar%20in%20the%20middle.png" rel="nofollow">http://dl.dropbox.com/u/77033905/tabBar%20in%20the%20middle.png</a></p> <p>Tell me pls answers on this questions:</p> <ol> <li>How to set custom background image for thisd tab bar? </li> <li>How to get selected item? </li> <li>How to default selected first item?</li> </ol> <p>For now I've created UITabBar and include in this ViewController, what's next?</p> <p>This is ViewController.h:</p> <pre><code>@interface ViewController : UIViewController&lt;UITabBarDelegate&gt; { UITabBar *tabBar; } @property (strong, nonatomic) IBOutlet UITabBar *tabBar; ... </code></pre> <p>View.m:</p> <pre><code>#import "ViewController.h" @interface ViewController () @end @implementation OfferViewController @synthesize tabBar; - (void)viewDidLoad { [super viewDidLoad]; UIImage *selectedImage0 = [UIImage imageNamed:@"HomeDB.png"]; UIImage *unselectedImage0 = [UIImage imageNamed:@"HomeLB.png"]; UIImage *selectedImage1 = [UIImage imageNamed:@"ScheduleDB.png"]; UIImage *unselectedImage1 = [UIImage imageNamed:@"ScheduleLB.png"]; UIImage *selectedImage2 = [UIImage imageNamed:@"BuildingsDB.png"]; UIImage *unselectedImage2 = [UIImage imageNamed:@"BuildingsLB.png"]; //UITabBar *tabBar = self.tabBar; UITabBarItem *item0 = [tabBar.items objectAtIndex:0]; UITabBarItem *item1 = [tabBar.items objectAtIndex:1]; UITabBarItem *item2 = [tabBar.items objectAtIndex:2]; [item0 setFinishedSelectedImage:selectedImage0 withFinishedUnselectedImage:unselectedImage0]; [item1 setFinishedSelectedImage:selectedImage1 withFinishedUnselectedImage:unselectedImage1]; [item2 setFinishedSelectedImage:selectedImage2 withFinishedUnselectedImage:unselectedImage2]; [super viewDidLoad]; } ... </code></pre> <p>How can I now default select item and get when user tabs on some tab bar item?</p>
 

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