viewwillappear

viewWillAppear not called after popToViewController

浪子不回头ぞ 提交于 2021-01-28 21:39:59
问题 I have a little problem. I am working on a simple application with Views Controllers in a Navigation Controller like this: A->B->C (-> are modal segues) View A is the Root View Controller and I need to come back to A from C. If I call the method popToViewController from B, A run the viewWillAppear; if I call the popToViewController from C (to A), viewWillAppear on A is not called. How can I solve this? (Working on Xcode7 and iOS 9) ViewController A #import "ViewControllerA.h" #import

UIView Animation and UIButton stop working b/c Home pressed - Swift 4

被刻印的时光 ゝ 提交于 2020-01-26 03:58:44
问题 I have a playButton that performs a "breathing animation". The button works just fine when I press it. The problem occurs if I press the device's Home Button and then re-open the app. Upon re-opening, the playButton does not have the "breathing animation" and it does not work (nothing happens when it is pressed). @IBOutlet weak var playButton: UIButton! override func viewWillAppear(_ animated: Bool) { UIView.animate(withDuration: 1.0, delay: 0, options: [.autoreverse, .repeat,

Determine viewWillAppear from Popped UINavigationController or UITabBarController

佐手、 提交于 2020-01-13 11:54:23
问题 I am unable to find a way to distinguish between popping from the Nav controller stack and entering the view controller from the UITabBarController. I want to call a method in ViewWillAppear only when the view is presented from the TabBar, not when someone presses back in the navigation controller. If I wasn't using a TabBarController, I could easily get this functionally using viewDidLoad. I've tried, override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) println("View

Determine viewWillAppear from Popped UINavigationController or UITabBarController

荒凉一梦 提交于 2020-01-13 11:51:10
问题 I am unable to find a way to distinguish between popping from the Nav controller stack and entering the view controller from the UITabBarController. I want to call a method in ViewWillAppear only when the view is presented from the TabBar, not when someone presses back in the navigation controller. If I wasn't using a TabBarController, I could easily get this functionally using viewDidLoad. I've tried, override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) println("View

view will disappear is not firing

冷暖自知 提交于 2020-01-04 09:37:07
问题 i am using addSubView method to add views. Did any alternative methods are there for viewWillDisappear? viewWillDisappear is not firing. I want to release all allocated objects when the current view get dissapear. Currently i am using dealloc method to do this. But dealloc method is firing not quickly. Since i am getting memory warings and sometimes the my app may crash itself. The main problem is with voice files. 回答1: addSubview/removeFromSuperview (these methods relate with views not view

Navigationbar coloring in ViewWillAppear happens too late in iOS 10

半城伤御伤魂 提交于 2019-12-28 11:45:22
问题 I am facing a weird bug, that happens only on iOS 10. I have a application with several screens, and each screen colors the navigationBar in viewWillAppear . So when you go to the next screen, it will be properly colored. However, when testing on iOS 10 I suddenly see the following behaviour when going back to a previous screen: When the previous screen appears the navigationBar still has the color of the previous screen and then flashes to the proper color. It almost looks like

UIViewController resizing itself between viewWillAppear and viewDidAppear?

本小妞迷上赌 提交于 2019-12-24 00:55:17
问题 I've got a really strange bug in my project. I've got a UIScrollView as my main, big view. Inside of it, I have a UIViewController (not UITableViewController ) which has a UITableView instance variable, as well as some miscellaneous UIButtons . I have set the view controller's view frame to CGRectMake(0, 64, 320, 388) , as I have a tab bar above it (this is not functional yet). At first it works great and looks great, but once I present and dismiss a modalViewController (thus reloading the

Xamarin IOS hide bar back button

只愿长相守 提交于 2019-12-23 16:14:05
问题 I am trying to hide the back button from my navigationcontroller on a certain view(using storyboard) I tried to hide the bar back button overriding the ViewWillAppear , but it does not seem to happen. Here is the code: public override void ViewWillAppear (bool animated) { base.ViewWillAppear (animated); this.NavigationController.NavigationItem.SetHidesBackButton (true, true); } 回答1: just change to : public override void ViewDidLoad () { base.ViewDidLoad (); this.NavigationItem

NSNotificationCenter with respect to ViewWillAppear and ViewWillDisapper

不羁岁月 提交于 2019-12-19 10:25:22
问题 I have a simple viewController that I want to listen for UIKeyboardWillHideNotification . Therefore I have the following code: - (void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillBeHidden) name:UIKeyboardWillHideNotification object:nil]; } - (void) keyboardWillBeHidden { [self.scrollView setContentOffset:CGPointMake(0, 0) animated:YES]; } I'm trying to decide when to remove the

Do I programmatically add SubViews in ViewDidAppear, ViewDidLoad, ViewWillAppear, the constructor?

人盡茶涼 提交于 2019-12-18 10:04:45
问题 I'm trying to figure out from Apple's sketchy documentation which method is the best place to be initializing and adding my Views controls to the controller's view. With winforms it's fairly straightforward, as they're always initialized inside InitializeDesigner , called in the constructor. I'm trying to match the reliability of this pattern if possible. I'm working with UIViewControllers and UITableViewControllers inside a UINavigationController most of the time - if this effects it all.