gpt4 book ai didi

ios7 setBackButtonBackgroundImage 图像仍然被拉伸(stretch)

转载 作者:行者123 更新时间:2023-11-28 18:01:08 25 4
gpt4 key购买 nike

使用以下代码设置全局导航后退按钮图像:

float imageSize = 21.5; // @2x is 43px width

UIImage *barBackBtnImg = [[UIImage imageNamed:@"arrow-back-white"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, imageSize, 0, 0)];

[[UIBarButtonItem appearance] setBackButtonBackgroundImage:barBackBtnImg
forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60)
forBarMetrics:UIBarMetricsDefault];

原图:http://cl.ly/XJgD和应用内(被拉伸(stretch)):http://cl.ly/XKc0

为什么图像仍然被拉伸(stretch)有什么想法吗?

最佳答案

如果有人感兴趣,这是我的解决方法:

[[UINavigationBar appearance] setBackIndicatorImage:[UIImage imageNamed:@"arrow-back-white"]];
[[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:[UIImage imageNamed:@"arrow-back-white"]];
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];

关于ios7 setBackButtonBackgroundImage 图像仍然被拉伸(stretch),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25612834/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com