uitoolbar

iOS Autolayout and UIToolbar/UIBarButtonItems

你说的曾经没有我的故事 提交于 2019-11-26 16:41:09
问题 I have an iOS view with autolayout enabled and have a UIToolbar with a UISearchBar and UISegmentControl contained with the toolbar. I want the UISearchBar to have a flexible width so I need to add a constraint to force this, but from what I can tell you cannot add constraints to items in a UIToolbar in Interface Builder. The options are all disabled. Before AutoLayout I would accomplish this with autoresizingmasks . Are constraints not allowed within UIToolbars/UINavigationBars ? How else can

Set rootViewController of UINavigationController by method other than initWithRootViewController

孤人 提交于 2019-11-26 15:36:50
问题 How Do I set the rootViewController of UINavigationController by a method other than initWithRootViewController ? I want use initWithNavigationBarClass:toolbarClass: to deliver a custom toolbar for my NavigationController, so I don't think I can use initWithRootViewController . 回答1: You can solve this by calling setViewControllers . Like this: UINavigationController *navigationController = [[UINavigationController alloc] initWithNavigationBarClass:[MyNavigationBar class] toolbarClass:

Show/hide UIToolbar, “match finger movement”, precisely as in for example iOS7 Safari

六眼飞鱼酱① 提交于 2019-11-26 11:11:56
问题 Note: check out Thuy\'s great subclass of UINavBar here: https://stackoverflow.com/a/20720359/294884 If you\'re working on this problem, GTScrollNavigationBar is close to a ready-made solution to the navBar problem! 50 point bounty here, amazing there are no answers. For example: on a 2014 iPhone, open Safari, load any web page. Look at the iOS toolbar at the bottom. Now move your finger up and down ONLY A FEW PIXELS . Basically the toolbar at the bottom, moves with your finger . Furthermore,

How to draw a transparent UIToolbar or UINavigationBar in iOS7

允我心安 提交于 2019-11-26 06:53:35
问题 I would like an entirely transparent UIToolbar and/or UINavigationBar . I have tried the various incantations suggested for pre- and post-iOS 5 but none seem to work any more. How might this be accomplished in iOS 7? 回答1: Swift 3 (iOS 10) Transparent UIToolbar self.toolbar.setBackgroundImage(UIImage(), forToolbarPosition: .any, barMetrics: .default) self.toolbar.setShadowImage(UIImage(), forToolbarPosition: .any) Transparent UINavigationBar self.navigationBar.setBackgroundImage(UIImage(), for

Creating a left-arrow button (like UINavigationBar's “back” style) on a UIToolbar

柔情痞子 提交于 2019-11-26 01:38:28
问题 I\'d love to create a \"back\" left-arrow-bezel button in a UIToolbar . As far as I can tell, the only way to get one of these is to leave UINavigationController at default settings and it uses one for the left bar item. But there\'s no way I can find to create one as a UIBarButtonItem , so I can\'t make one in a standard UIToolbar , even though they\'re very similar to UINavigationBar s. I could manually create it with button images, but I can\'t find the source images anywhere. They have