0

我在 UINavigationBar 上使用透明背景时遇到了一些问题,我总是得到一个黑色渐变......这是我的代码:

self.tableView = [[TableController_iPad alloc] initWithNibName:@"TableController_iPad" bundle:nil];

UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:self.tableView];
[navi.navigationBar setBackgroundColor:[UIColor clearColor]];
[navi.navigationBar setTintColor:[UIColor clearColor]];
[navi.navigationBar setTranslucent:YES];
[navi.navigationBar setOpaque:YES];
[navi.navigationBar setShadowImage:[UIImage imageNamed:@"trasparent.png"]];
[navi.navigationBar setBackgroundImage:[UIImage imageNamed:@"trasparent.png"] forBarMetrics:UIBarMetricsDefault];


[self addChildViewController:navi];

[viewTesti addSubview:navi.view];
4

0 回答 0