开发者

show always a uiimage on the top of a tabbar

开发者 https://www.devze.com 2023-02-20 20:34 出处:网络
i searched before post my question, but i find nothing useful. before: i\'m a c# developer and i\'m doing my first iphone app, don\'t kill me please!

i searched before post my question, but i find nothing useful.

before: i'm a c# developer and i'm doing my first iphone app, don't kill me please!

in my app i have a tabbar controller on the bottom (4 buttons) each button, is a navigation controller type, its show a navigation bar on the top and in the middle i have a viewcontroller (norm开发者_如何转开发ally after i load an uitableview)

the mad person that asked me to do this app wants that in the top of the TabBar to show always an image (for advertisement, fixed as 320x50).

so the app should look in this way

< NavigationBar >

ViewController

< UIImage >

< TabBar >

but now is

< NavigationBar >

ViewController

< TabBar >


at first take tabbarview controller then make view controller then set the UIimage then set the navigation bar for the uiview controller

NSMutableArray *listOfViewControllers = [[NSMutableArray alloc] init];

        dashBoardView = [[DashboardViewController alloc] initWithNibName:@"DashboardViewController" bundle:nil];
        dashBoardView.title = @"dashBoardView";
        UINavigationController *mydashboarController = [[[UINavigationController alloc] initWithRootViewController:dashBoardView] autorelease];
        mydashboarController.navigationBar.barStyle = UIBarStyleBlack;
        [listOfViewControllers addObject:mydashboarController];
        [dashBoardView release];

        ordersView = [[OrdersViewController alloc] initWithNibName:@"OrdersViewController" bundle:nil];
        ordersView.title = @"ordersView";
        UINavigationController *myorderController = [[[UINavigationController alloc] initWithRootViewController:ordersView] autorelease];
        myorderController.navigationBar.barStyle = UIBarStyleBlack;
        [listOfViewControllers addObject:myorderController];
        [ordersView release];

        orderList = [[OrderListViewController alloc] initWithNibName:@"OrderListViewController" bundle:nil];
        orderList.title = @"orderList";
        UINavigationController *myorderListController = [[[UINavigationController alloc] initWithRootViewController:orderList] autorelease];
        myorderListController.navigationBar.barStyle = UIBarStyleBlack;
        [listOfViewControllers addObject:myorderListController];
        [orderList release];


        [self.tabBarController setViewControllers:listOfViewControllers animated:YES];

i think it will help you some way...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号