在我的 iPad 应用程序取景器中 (iTunes 链接),我正在尝试重新创建 UISegmentedControl 的外观,如 Keynote 的“内置”弹出窗口的页脚中所示:
iPad HIG 建议使用底部对齐的 UIToolbar,但外观不正确。此屏幕截图显示黑色不透明,但没有一个标准样式与 Keynote 匹配。
任何有关重新创建 Keynote 外观的建议将不胜感激。如果您在 iPad 上没有 Keynote,您可以在地图中书签弹出框的页脚中看到相同的技术。
你需要的是设置toolbarItems
你的上衣UIViewController
在你的UIPopover
并正确配置它。考虑这样的事情:
NSArray *segmentedItems = [NSArray arrayWithObjects:@"Bookmarks", @"Recents", @"Contacts", nil];
UISegmentedControl *ctrl = [[UISegmentedControl alloc] initWithItems:segmentedItems];
ctrl.segmentedControlStyle = UISegmentedControlStyleBar;
ctrl.selectedSegmentIndex = 0;
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:ctrl];
ctrl.frame = CGRectMake(0.0f, 5.0f, 320.0f, 30.0f);
NSArray *theToolbarItems = [NSArray arrayWithObjects:item, nil];
[self setToolbarItems:theToolbarItems];
[ctrl release];
[item release];
编辑:现在我明白了,只是不设置tintColor,它将继承正确的颜色(无论它是什么)。下面的屏幕截图现在看起来与 Google 地图应用程序中的屏幕截图一模一样:
替代文本 http://www.memorylifter.com/services/dev/linklist/SCREENSHOT_TABBAT.png
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)