2013-04-08 27 views
0

我想更改更多導航控制器的背景圖像。我使用下面的代碼進行搜索並嘗試。如何在ios 6中爲UITabBarController的「更多」導航控制器設置背景圖像

here is the customize tab bar or more navigation controller image.

我下面的代碼,但 !![it over rides the tableview and looks like below image `] 2

self.tabBarController = [[UITabBarController alloc] init]; 
self.tabBarController.delegate=self; 
tabBarController.moreNavigationController.delegate = self; 


if ([tabBarController.moreNavigationController.topViewController.view isKindOfClass:[UITableView class]]) 
{ 
    UIView* newView = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,367)]; 

    UIImageView* imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bg.png"]]; 
    imageView.opaque = NO; 
    imageView.alpha = 0.4; 
    [newView addSubview:imageView]; 

    tabBarController.moreNavigationController.topViewController.view.backgroundColor = [UIColor clearColor]; 
    tabBarController.moreNavigationController.topViewController.view.frame = CGRectMake(0,0,320,367); 
    //[newView addSubview:tabBarController.moreNavigationController.view]; 
[newView addSubview:tabBarController.moreNavigationController.topViewController.view]; 
    tabBarController.moreNavigationController.topViewController.view = newView; 
} 

`] 2

試過的任何一個建議我要去的地方錯可以理解

「謝謝「

+0

請嘗試在這裏:http://stackoverflow.com/questions/12150788/customize-the-more-uibarbuttonitem-in-uitabbar – shannoga 2013-04-08 06:26:23

+0

嘗試解決方案http://stackoverflow.com/questions/10158059/adding-uibarbuttonitem-to -all-navigation-view-controllers-inside-a-uitabbarcontr – 2013-04-08 06:33:54

+0

http://stackoverflow.com/questions/6692517/change-navigation-bar-background-image-on-each-navigation – Spynet 2013-04-08 07:21:51

回答

0

[tabBarController.moreNavigationController.topViewController.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@「bg.png」]]];

相關問題