Tab Bar Application Part 2
Step 1
create again the previous project
Step 2
add "tab bar item images" to your project
Step 3
click the "FirstTabView.m"
change the code like this
//
// FirstTabView.m
// TabBarExample
//
// Created by Apple on
4/24/13.
// Copyright (c) 2013
Dhanushka Adrian. All rights reserved.
//
#import "FirstTabView.h"
@interface FirstTabView ()
@end
@implementation FirstTabView
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle
*)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom
initialization
// Set the
Title Name of Title Bar
self.title = @"First";
// Set the
Tab Image of Tab Bar which belongs to view
self.tabBarItem.image = [UIImage imageNamed:@"icon1"];
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any
additional setup after loading the view from its nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose
of any resources that can be recreated.
}
@end
Run the app & check what happen
"ViewController.m" didn't have this method
"- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil"
then you have to copy paste the that same code into " ViewController.m "
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
// Set the Title Name of Title Bar
self.title = @"Fourth";
// Set the Tab Image of Tab Bar which belongs to view
self.tabBarItem.image = [UIImage imageNamed:@"icon4"];
}
return self;
}
Step 4
Run your App
Good Luck!
Tutorial List
- SQLite Based iPhone Application
- json with IOS (Basic) - Tutorial
- Simple Table View in IOS
- Load Distinct Images from array into UITableView
- Simple UIPickerView Example
- Tab Bar Application Part 1
- Tab Bar Application Part 2
- Tab Bar Application Part 3 ( with Login Screen )
- Tab Bar Application Part 4 ( Navigation )
- Table View Design in IOS Part 1
- Table View Design in IOS Part 2 ( Time Table )
- How to Add search bar in Table View
- Local Notification in IOS
- Core Data (For Beginners )
- Core Data Tute 2 (Add/Delete/Search)
- Core Data Tute 3 (Two table)
No comments:
Post a Comment