2
我想SOT集图像背景的左后卫按钮导航栏为所有在这个片段中的应用:UINavigation栏按钮的背景图像尺寸
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if (version >= 5.0)
{
// iPhone 5.0 code here
UIImage *image = [UIImage imageNamed: @"btn_back.png"];
image = [image stretchableImageWithLeftCapWidth:40.0f topCapHeight:0.0f];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:image forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
}
return YES;
}
我在stretchableImageWithLeftCapWidth一直在尝试不同的值:但最好的结果是这样的:
如何设置背景图片,以正确的大小?
感谢
感谢您的帮助! – theomen