uinavigationbar

Back Button Image - what is it called in Swift?

本秂侑毒 提交于 2019-12-28 16:14:12
问题 I am trying to use Swift's internal back button image. I have asked this question before and got the technically correct answer that it inherits it from the previous View, BUT if I insert this code you can control the back button on the current View. // Takeover Back Button self.navigationItem.hidesBackButton = false let newBackButton = UIBarButtonItem(title: "<", style: .Plain, target: self, action: "segueBack") navigationItem.leftBarButtonItem = newBackButton That gives me a <, "ABC" would

UINavigationBar UIBarButtonItems much larger click area than required

房东的猫 提交于 2019-12-28 11:44:10
问题 hopefully someone can help me out- iv'e scoured the net for the answer and cannot find one- the UIBarButtonItems added to UINavigationBar have a much larger click area than required- for example, open up any project you have a nav bar with buttons on- click anywhere between the end of the button and the title of the nav bar- the button clicks, when you clearly did not click on the button- also try this- click underneath the nav bar, below the button, the button clicks for about 5+ pixels

adding more than two button on the navigationbar

我们两清 提交于 2019-12-28 10:06:35
问题 I am trying this but it does not work. -(void)viewDidLoad { // create a toolbar where we can place some buttons UIToolbar* toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 100, 45)]; [toolbar setBarStyle: UIBarStyleBlackOpaque]; // create an array for the buttons NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:3]; // create a standard save button UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target

UINavigationController and UINavigationBarDelegate.ShouldPopItem() with MonoTouch

懵懂的女人 提交于 2019-12-28 06:01:49
问题 How do I pop up an UIAlertView when the back button of a UINavigationBar (controlled by a UINavigationController) was tapped? Under certain conditions, I want to ask the user an "Are you sure?" type of question so he could either abort the action and stay on the current view or pop the navigation stack and go to the parent view. The most appealing approach I found was to override ShouldPopItem() on UINavigationBar's Delegate. Now, there is a quite similar question here: iphone

iPhone Pushing View Controller in a left direction

北战南征 提交于 2019-12-28 05:43:11
问题 I have an app that has a centre view with two views off to each side of it. I want to have two navigation bar buttons, left and right which push a new navigation controller onto the view from the left or the right. When you change views by pushing a new view using the pushviewController: method of NavigationController, the view appears to slide in from the right. how do i change this to slide in from the left? 回答1: Instead of using a navigation controller, I would just move the view. CGRect

Hide NavigationBar when scrolling tableView in CollectionView?

余生长醉 提交于 2019-12-28 05:40:07
问题 I have collectionViewController and collectionViewCell include TableView.CollectionView is horizontal layout.I want hide navigationbar when scroll the tableView. Is there any idea about that. 回答1: Since iOS 8 you can just use self.navigationController?.hidesBarsOnSwipe = true This requires of course that your ViewController is embedded in a NavigationController. All child VC of the NavigationController will inherit this behaviour, so you might want to enable/disable it in viewWillAppear . You

Change width of a UIBarButtonItem in a UINavigationBar

只愿长相守 提交于 2019-12-28 04:01:09
问题 I am creating a UIBarButtonItem and adding it to my navigation bar like so: (void)viewDidLoad { ... // Add the refresh button to the navigation bar UIButton *refreshButton = [UIButton buttonWithType:UIButtonTypeCustom]; [refreshButton setFrame:CGRectMake(0,0,30,30)]; [refreshButton setImage:[UIImage imageNamed:@"G_refresh_icon.png"] forState:UIControlStateNormal]; [refreshButton addTarget:self action:@selector(refreshData) forControlEvents:UIControlEventTouchUpInside]; UIBarButtonItem

Increase NavigationBar height

落爺英雄遲暮 提交于 2019-12-28 03:10:11
问题 I have the following code: func navbarbutton() { UIView.animateWithDuration(0.2, animations: { () -> Void in let current = self.navigationController?.navigationBar.frame self.navigationController?.navigationBar.frame = CGRectMake(self.frame!.origin.x, self.frame!.origin.y, self.frame!.size.width, current!.size.height + 50) self.navigationController?.navigationBar.layoutIfNeeded() }) } I'm able to increase the height of the navigation bar by 50 dp. That's not the issue for me. The issue I'm

iOS 7 | Navigation bar / Toolbar buttons very close to status bar

与世无争的帅哥 提交于 2019-12-28 01:42:12
问题 I have a problem when dragging a navigation bar or toolbar (storyboard) to my view controller. UINavigationBar: As you can see in the image above, the right button is almost overlapping the status bar. With a UIToolbar it happens the same: This view controllers are intended to be used as a Modal, that's the reason I'm not using a UINavigationController. In another section I use a UINavigationController and it appears as I expect: How can I drag a UINavigationBar / UIToolbar to a view

How can I change height of Navigation Bar - Swift 3

 ̄綄美尐妖づ 提交于 2019-12-27 17:37:29
问题 I'm pretty sure this is not duplicate because I looked at other answers and they all outdated and do not provide exact answer. I have Navigation Controller and several view controllers. I want to make Navigation Bar a bit taller so it would fit text size that I need. How can I do that ? I tried this: UINavigationBar.appearance().frame = CGRect(x: 0.0, y: 0.0, width: 320.0, height: 210.0) but nothing happens... Also, I wasn't able to add any constraints to the Nav Bar using Xcode layout