navigationcontroller

snapshotView(afterScreenUpdates: true) returns an empty view

依然范特西╮ 提交于 2021-02-07 07:46:10
问题 I want to implement a custom push-transition for a navigation controller. I first implemented the UINavigationControllerDelegate where I return an Object of UIViewControllerAnimatedTransitioning . In this class, I want to take a snapshot of the destination view in order to animate it. However, for the push-segue, this doesn't work - the snapshot ist empty. [ when I pop back, I set afterScreenUpdates = false and everything works ] guard let fromVC = transitionContext.viewController(forKey:

self.navigationController is nil after adding subview

允我心安 提交于 2020-01-14 04:37:10
问题 here is my productscontroller.h ProductListViewController *productListViewController; ProductGridViewController *productGridViewController; UIButton *flipIndicatorButton; and i am adding list and gridview as a subview like this in my implementation ProductListViewController *listController = [[ProductListViewController alloc] initWithNibName:@"ProductListView" bundle:nil]; self.productListViewController = listController; self.productListViewController.CurrentSale = CurrentSale; [self.view

My navigation bar's large title is too wide. How to fix that?

亡梦爱人 提交于 2020-01-01 05:01:06
问题 I am using navigation controller, and I've set to true its navigation bar's prefersLargeTitle property. Everything works fine, but when the text of my title becomes too big, it doesn't fit in space. Here how it looks: Is it possible to somehow make the title (while the navigation bar's prefersLargeTitle property is set to true) dynamically adjust its font size, and if it is so, how to achieve that? 回答1: This question is somewhat answered here: How to resize Title in a navigation bar

Custom navigation bar

旧巷老猫 提交于 2019-12-31 08:15:22
问题 I was crawling Dribble and found the attached design. I was wondering how to do a custom navigation bar like this. I mean how create the navigation bar once and reuse it implicitly for every view controllers. I was thinking about having a kind of root view controller and inherit for other view controllers, but I don't know how to do this. Any idea or link will be appreachated! Cheers. Cyril 回答1: Thanks to iOS5 you are now able to customise the appearance of a UINavigationBar without having to

UINavigationItem out of sync when using popToRootViewController

最后都变了- 提交于 2019-12-25 06:47:34
问题 I tap a tab bar item, which triggers poptoRootViewControllerAnimated. Most of the time it works as expected, but in some cases it pops to the correct view, but the navigation item is out of sync, "stuck" from the view i previously was at. I've read about people having this problem with iPad's, when in landscape mode, but the solutions I've found don't work in this case. This is an iPhone app in portrait mode. Happens with the simulator as well as on an actual iPhone. If someone has a

How to add a border to swift navigationBar after removing it

爱⌒轻易说出口 提交于 2019-12-25 01:37:46
问题 I use: self.navigationController?.navigationBar.shadowImage = UIImage() to remove the border of a navigationBar earlier in my app but now I'm not sure to add the border back on a later screen. 回答1: To reset the navigationBar 's shadowImage to the default shadowImage do the following: self.navigationController?.navigationBar.shadowImage = UINavigationBar().shadowImage 来源: https://stackoverflow.com/questions/57401651/how-to-add-a-border-to-swift-navigationbar-after-removing-it

iOS disable animation for NavigationController back button

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 15:32:30
问题 I want to disable the animation when i pop a ViewController with the back button in NavigationController. I tried: override func viewWillDisappear(animated: Bool) { super.viewWillDisappear(false) } But it still animates. 回答1: In the Controller that you want to have that button: override func viewDidLoad() { super.viewDidLoad() self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Back", style: .Plain, target: self, action: "backTapped:") } func backTapped(sender: UIBarButtonItem) {

Swift: Programmatically transitioning from 1 view to another via a TabBar and Navigation Controller

北战南征 提交于 2019-12-24 05:47:11
问题 The user logs in and lands on viewNumOne, they fill out their name and address and get to see viewNumTwo and viewNumThree. They now logout. When they log back in I want them to go straight to viewColorBlue (this is where I am having the problem). (Login Screen) View Controller with login fields. Once logged in they go to the rootVC which is a TabBar and they land on the first tab which is viewNumOne (this works fine) (Root) TabBar: (First Tab - tabBar[0]) viewNumNavController > viewNumOne

'NSInternalInconsistencyException', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name

落爺英雄遲暮 提交于 2019-12-23 23:58:43
问题 I have a window based applicaiton with tab bar and navigation bar integrated into it. On the navigation bar have a custom button which opens a table view. On clicking on the cell of the table I want to open a new table view controller. But as soon as I click on the cell of first table I get an exception that Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name 'AddForm'' I have checked

NSInvalidArgumentException “Unrecognized selector sent to instance” (using MPMoviePlayerController)

给你一囗甜甜゛ 提交于 2019-12-23 12:26:13
问题 Well, I have a TableView in a RootViewController with a DetailViewController for the display of the information of the single record. In the Detail page i have to play a multimedia file and i'm using the framework MediaPlayer, according to this guide: http://www.techotopia.com/index.php/Video_Playback_from_within_an_iOS_4_iPhone_Application it seems all ok, but when i click on the play button i have this error: -[DetailsViewController playmovie]: unrecognized selector sent to instance