uinavigationcontroller

Setting attributed label as navigation title

人盡茶涼 提交于 2019-12-23 04:30:45
问题 I am working on IOS using swift 4. I have to make the Navigation controller, with the center Aligned App title with Image at its left. But I am not getting how to attach image to its left. The attributed Image always goes to its right. For this I am appending the string twice. below is the code //Get image and set it's size let image = UIImage(named: "user2") let newSize = CGSize(width: 30, height: 30) //Resize image UIGraphicsBeginImageContextWithOptions(newSize, false, 0.0) image?.draw(in:

How to add a return button for ABPersonViewController's navigationbar?

女生的网名这么多〃 提交于 2019-12-23 04:21:05
问题 When I display an ABPersonViewController , I need a button that allows me to dismiss it and return to the previous screen. How do I add this? 回答1: Oh, I got the answer. ABPersonViewController *personViewController = [[ABPersonViewController alloc] init]; personViewController.addressBook = addr; personViewController.displayedPerson = ABAddressBookGetPersonWithRecordID(addr, (ABRecordID)personID); personViewController.allowsEditing = YES; personViewController.personViewDelegate = self;

Autorotation in ios5--most common reasons why it fails?

末鹿安然 提交于 2019-12-23 03:35:31
问题 I'm confused about the implementation of autorotation in ios. I have a UIViewController, and I tell it to autorotate inside shouldAutoRotateToInterfaceOrientation. However, it doesn't work. So I read something about how I need to look at the navigation stack AND/OR whether a UITabBarController was used, because this has been known to cause all kinds of confusion (raises hand). In fact, I have a UITabBar and a UINavigationController. The UIView that I want to rotate is being pushed onto the

Swift: Instantiate a view controller for custom transition in the current navigation stack

点点圈 提交于 2019-12-23 02:58:12
问题 Introduction I'm creating an app that has, in its rootViewController, a UITableView and a UIPanGestureRecognizer attached to a small UIView acting as a "handle" which enables a custom view controller transition for a UIViewController called "SlideOutViewController" to be panned from the right. Issue I have noticed two issues with my approach. But the actual custom transition works as expected. When the SlideOutViewController is created it is not attached to the navigation stack I believe,

Push UINavigationController programmatically. iOS9

£可爱£侵袭症+ 提交于 2019-12-23 02:42:41
问题 I want to display a navigation controller programmatically. This code works perfect on iOS 8, but on iOS 9 it doesn't work. var vc = storyboard?.instantiateViewControllerWithIdentifier("view_controller_id") as! UIViewController; var nc = UINavigationController() nc.setViewControllers([vc], animated: false) navigationController?.pushViewController(nc, animated: true) After that I am getting this error *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing

How to lock orientation in UINavigationControllers

情到浓时终转凉″ 提交于 2019-12-23 02:36:26
问题 As the ShouldAutorotateToInterfaceOrientation is deprecated in iOS 6 I am not able to lock the orientation in my app. In my app I have UINavigationControllers with multiple views, some views need to support both portrait and landscape, while other views need to support portrait only. How can I over come this problem please suggest me some idea. Thanks 回答1: Use this function only work in iOS 6 -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } -

Programming UIViewControllers cycles with ios and storyboard

╄→尐↘猪︶ㄣ 提交于 2019-12-23 02:29:15
问题 I am just starting ios development with IOS 5 and storyboards and would like to know how I can solve the following problem: I have a tree hierarchy with categories an products being nodes of the tree and products are leaves. I created a TileViewController view to display all nodes at a specific level. When the user selects a node in the TileView, depending on its type (leaf or not-leaf) I either push a new TileViewController into the application NavigationController or I show a

iOS8 issue when trying to push multiple UIViewControllers in NavigationController

血红的双手。 提交于 2019-12-23 02:21:32
问题 I have 6 UIViewControllers connected with push segues with identifiers and a functionality in my app to 'jump' to the desired UIViewController using this method for stacking ViewControllers: - (void) JumpTo6 { UINavigationController *nav = self.navigationController; UIViewController *a =[self.storyboard instantiateViewControllerWithIdentifier:@"2"]; [nav pushViewController:a animated:NO]; UIViewController *b =[self.storyboard instantiateViewControllerWithIdentifier:@"3"]; [nav

UITabBarController/UINavigationController rotation issues

不打扰是莪最后的温柔 提交于 2019-12-23 01:52:44
问题 My problem is the following: I want to only allow Portrait orientation on all my ViewControllers except 1 ViewController which is supposed to allow both Portrait and landscapeLeft/Right. I have now spent almost 2 days into how to set orientation in IOS for different slides/ViewControllers. After some searching I found this thread here at stack: UITabBarController Rotation Issues in ios 6 I followed Kunani's example in that thread which I will post here to save all readers some time: Zack, I

UINavigationBar Bottom Separator Line Color

℡╲_俬逩灬. 提交于 2019-12-23 01:27:19
问题 How can I change the line's color that separates the navigation bar and the view? For instance flickr changed it to gray (http://www.geardiary.com/wp-content/uploads/2009/09/Screen-shot-2009-09-08-at-8.00.06-AM.png) By default mine is always black... Thanks in advance for your help, nico 回答1: They used a custom bottom bar and not the Apple provided ones. I dont know your setup, but if you can make or draw your own custom view however you want (you can do this), and stick buttons on it (you