UIImage *backgroundImage = [UIImage imageNamed:@"导航栏背景"];
[self.navigationController.navigationBar setBackgroundImage:backgroundImage forBarMetrics:UIBarMetricsDefault];
一开始这样写,发现在plus上无法填满
image.png
加一句就妥了:
UIImage *backgroundImage = [UIImage imageNamed:@"导航栏背景"];
backgroundImage = [backgroundImage resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeStretch];
[self.navigationController.navigationBar setBackgroundImage:backgroundImage forBarMetrics:UIBarMetricsDefault];
image.png
网友评论