uinavigationcontroller

UINavigationBar slides away instead of staying on place

给你一囗甜甜゛ 提交于 2019-12-22 08:23:50
问题 I created demo project to show the problem. We have two view controllers inside UINavigationController. MainViewController which is the root. class MainViewController: UIViewController { lazy var button: UIButton = { let button = UIButton() button.setTitle("Detail", for: .normal) return button }() override func viewDidLoad() { super.viewDidLoad() navigationItem.title = "Main" view.backgroundColor = .blue view.addSubview(button) button.translatesAutoresizingMaskIntoConstraints = false button

How to disable auto-rotation for specific View Controllers inside a Navigation Controller (Swift)? [duplicate]

心不动则不痛 提交于 2019-12-22 05:59:54
问题 This question already has answers here : locking orientation does not work on ipad ios 8 swift xcode 6.2 (5 answers) Closed 4 years ago . ^Above does not have answer at all...Having issues disabling auto rotation for specific (not all) View Controllers that are inside a navigation controller. Similar questions do not address the ability to disable autorotation for specific view controllers but rather to disable autorotation in all of the view controllers inside of a navigation controller. My

popViewController does not autorotate back to allowed orientation

我与影子孤独终老i 提交于 2019-12-22 05:48:05
问题 I have two UIViewControllers, "A" and "B", where "A" overrides the shouldAutorotateToInterfaceOrientation to return YES for UIInterfaceOrientationPortrait, and "B" returns YES for all orientations. In my example "A" is the root navigation view controller, and I then use pushViewController for "B". After that I rotate the device into landscape, which successfully autorotates "B", then I pop "B" (back button or via popViewController) to return to "A". When targetting iPhone OS 3.1.3, "A"

Double Clicking on UITabBarControllers Tab goes to root of Navigation controller

守給你的承諾、 提交于 2019-12-22 05:42:13
问题 I have a UITabBarController setup with 2 UINavigationControllers. One UINavigationController has One UIViewController, the other UINavigationController has Two UIViewControllers. If you then navigate to the second UIViewController and click the Tab that is already selected it bring you to the root of the UINavigationController (This would be the first UIViewController). Is there a way to stop this from happening? I do not want the user to be able to click an already selected Tab to go to the

Change position of navigationItem.title

感情迁移 提交于 2019-12-22 05:22:29
问题 In my ViewDidLoad I try something like that but its not working: UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10,2,60,14)]; label.autoresizingMask = UIViewAutoresisingFlecibleWidth; [self.navigationController.navigationBar addSubview:label]; I want to display a label in the left part of my NavigationBar. Or maybe change the navigationBar.title position Thanks, 回答1: You can do set navigation item's title view to UILabel with left text alignment: UILabel* lbNavTitle = [[UILabel

viewWillAppear vs Viewdidload ios

血红的双手。 提交于 2019-12-22 04:51:12
问题 When code with iOS navigation application, I have facing with trouble this: where can I put the method "initdata" for UITableView? in viewWillAppear or viewDidLoad? please help me out. 回答1: You can put initData as per your requirement of the app, if your table needs to load data every time with new Data then it should be under - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; //initData } Otherwise, if the table needs to be reload by a single Data which doesn't vary or

How to resize UINavigationController in a storyboard editor

雨燕双飞 提交于 2019-12-22 04:15:18
问题 When I want resize an UIViewController in a storyboard editor window I do: I put size to "freeForm" in the UIViewController attributes inspector I select the view and resize her with the size inspector after that, the uiViewController is resized in storyboard window. Next, I select the view controller, click on: edit > embeded in> Navigation Controller and the problem is that navigation controller is in full size and not the same size that UIViewController. I don't find how resize this

Views getting darker when are pushed on navigation controller

守給你的承諾、 提交于 2019-12-22 04:11:53
问题 I'm pushing ViewControllers on NavigationController by segues. I have my own subclassed NavigationController which has inserted UIImageView at index 0 - it's a background for my entire application. The problem is that I can see that when new view controller is coming to the screen from the right side, in the beginning it's like having some light dark overlay which is disappearing when just after viewDidApear is called. Every view controller has a self.view.backgroundColor = [UIColor

performSegueWithIdentifier produce no segue with identifier error

夙愿已清 提交于 2019-12-22 03:22:47
问题 I am having hard time getting performSegueWithIdentifier to work. I keep getting "Receiver (<UINavigationController: 0x1e59a9d0>) has no segue with identifier 'identA'" What I did is that: Step: created a single view application and added a label - "View controller A" to the view controller. Step: Dragged and dropped another View Controller and added a label - "View controller B" to the new view controller. Step: Chose view controller A and performed Editor->embed in->navigation controller

How to create a UINavigationItem.TitleView based upon a nib file?

蓝咒 提交于 2019-12-22 00:48:53
问题 I have a UINavigationController bassed sequence of screens. On one of the screens I want to replace the standard title with a custom TitleView. The custom view will be created with a nib file and will have an image and several labels. Do I create a UIViewController w/ associated nib file, load the nib, and assign the .view property to the TitleView? Basically, how do I use a nib where I can layout the necessary elements and then assign the resulting view to the TitleView property? 回答1: