mad*_*cat 2 uinavigationbar uitableview ios6
当我尝试将自定义背景添加到导航栏时,它们在表视图顶部没有投影.在子视图中一切都很好.
这是我使用的代码.
// Create resizable images
UIImage *gradientImage44 = [[UIImage imageNamed:@"navbar"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
// Set the background image for *all* UINavigationBars
[[UINavigationBar appearance] setBackgroundImage:gradientImage44
forBarMetrics:UIBarMetricsDefault];
// Customize NavBar Shadow
[[UINavigationBar appearance] setShadowImage:nil];
Run Code Online (Sandbox Code Playgroud)
不存在投影
我的导航栏http://f.cl.ly/items/2v2U011H240g1m1D3b44/Screenshot_08.03.13_10_06-2.png
现有投影
子视图http://f.cl.ly/items/0Q160m25130O1z10000v/Screenshot_08.03.13_10_19.png
更新:找到这个答案,但不起作用.我完全以同样的方式做到了:-(.
我通过重新实现导航控制器来修复它.视图层次结构看起来像这样.
UIView
+- Navigation View
+- Table View
Run Code Online (Sandbox Code Playgroud)
我将UIView更改为表视图并将其添加到UINavigation Controller.这修复了丢失的阴影问题.
| 归档时间: |
|
| 查看次数: |
1290 次 |
| 最近记录: |