Customize UINavigationBar and remove drop shadow at the bottom of UINavigationBar

黄永怡
2023-12-01
UIImage *navigationBarImg = [ UIImage imageNamed : @"navigationBar" ];

//You must specified the BarMetrics for UINavigationBar, Otherwise it reports an exception. 

[[UINavigationBar appearance] setBackgroundImage:navigationBarImg forBarMetrics:UIBarMetricsDefault]; 

//This is the key to eliminate drop shadow of UINavigationBar

[[ UINavigationBar appearance ] setShadowImage :[[ UIImage alloc ] init ]];
 类似资料:

相关阅读

相关文章

相关问答