TabBar.h
#import <UIKit/UIKit.h>
#define tabBarFrame CGRectMake(0, 768, 1024, 48)
@interface TabBarIphone : UITabBarController <UITabBarControllerDelegate, UITabBarDelegate> {
@public
UIView *view;
}
-(void)setFor:(NSString*)str;
- (void) loadBookContent;
-(void) addCustomElements;
-(void) selectTab:(int)tabID;
@end
#import "TabBarIphone.h"
#import <QuartzCore/QuartzCore.h>
#import "AppDelegate.h"
@implementation TabBarIphone
AppDelegate *appDelegate;
NSString *strForPurpose;
NSString *strAdd;
#pragma mark -
#pragma mark Custom Methods
/*-(void) onClickSave {
[appDelegate saveAction];
}*/
TabBar.m
#pragma mark -
#pragma mark Init Methods
-(id) init {
[super init];
appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
self.delegate = self;
self.customizableViewControllers = nil;
return self;
}
#pragma mark -
#pragma mark View Methods
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationController.navigationBar.hidden = FALSE;
self.tabBar.backgroundColor = [UIColor whiteColor];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self tabBar].hidden = FALSE;
}
-(void)setFor:(NSString*)str {
strAdd=str;
}
- (BOOL)tabBarController:(UITabBarController *)tabBarController
shouldSelectViewController:(UIViewController *)viewController {
//NSLog(@"didSelectItem:(UITabBarItem *)item %@ ",viewController);
return TRUE;
}
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
{
[appDelegate.navHome popToRootViewControllerAnimated:YES];
[appDelegate.navNotes popToRootViewControllerAnimated:YES];
[appDelegate.navUpload popToRootViewControllerAnimated:YES];
[appDelegate.navResearch popToRootViewControllerAnimated:YES];
[appDelegate.navForum popToRootViewControllerAnimated:YES];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0) {
[self setSelectedIndex:0];
}
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
#pragma mark -
#pragma mark Memory Management
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
- (void)dealloc {
[super dealloc];
}
@end
No comments:
Post a Comment