0

我想更改更多导航控制器的背景图像。我用谷歌搜索并尝试了以下代码。

这是自定义标签栏或更多导航控制器图像。

我尝试使用下面的代码但是!! [它越过桌面视图,如下图所示`] 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

任何人建议我哪里出错将不胜感激

“谢谢”

4

1 回答 1

0

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

于 2013-04-08T06:59:42.090 回答