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