【发布时间】:2013-09-26 20:52:30
【问题描述】:
使用 iOS 7 SDK 构建我的应用会改变导航栏及其按钮的外观:
上图显示了在使用 iOS 6 的设备上运行时的外观,下图显示了在使用 iOS 7 的设备上运行的相同应用。
导航栏是使用背景图片创建的:
UIImage *navigationBarBackgroundImage = [[UIImage imageNamed:@"MyTopNavigationBackground"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 4, 0)];
UINavigationBar *bar = [UINavigationBar appearanceWhenContainedIn:[MyNavigationController class], nil];
[bar setBackgroundImage:navigationBarBackgroundImage forBarMetrics:UIBarMetricsDefault];
[bar setTintColor:[UIColor colorWithRed:0.17 green:0.62 blue:0.23 alpha:1.0]];
左栏按钮的创建者:
- (UIBarButtonItem *)slideoverMenuBarButtonItem {
return [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"bar_button_icon_menu.png"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(slideoverMenu)];
}
我更关心按钮外观发生了什么。处理向新 iOS 7 外观过渡的“最佳做法”是什么?
【问题讨论】:
标签: iphone ios objective-c ipad user-interface