我为UITabBar
创建了此图片:
这就是我将它添加到标签中的方式:
[[UITabBar appearance] setBackgroundImage:[UIImage imageNamed:@"NewTabBar.png"]];
[[UITabBar appearance] setSelectionIndicatorImage:[UIImage imageNamed:@"tabbar_selection.png"]];
我注意到当我将设备旋转到横向模式时,图像不会重新调整到所有屏幕的大小。 我怎么能重新调整大小?
答案 0 :(得分:1)
尝试合并resizableimageWithCapInsets:
,如下所示:
[[UITabBar appearance] setSelectionIndicatorImage:[[UIImage imageNamed:@"tabbar_selection.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(5, 5, 5, 5)]];
答案 1 :(得分:-1)
尝试
self.tabBarController.tabBar.autoresizingMask=UIViewAutoresizingFlexibleRightMargin || UIViewAutoresizingFlexibleLeftMargin;
或试验它;