0

I created regular buttons in .xib file and I added a gradient effect to them and shadows in the code in this section:

-(void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated];

... my customized buttons code here

}

When I modally switch to another view controller and then go back to the original one the xib file gets redrawn but all the gradient effects and shadows disappear. Any ideas?

Darko
  • 203
  • 2
  • 10

2 Answers2

1

I'm not sure entirely what's going on, but note that after you dismiss the modal view controller, viewDidAppear: gets called again. If you only want to make these buttons once, you could move your custom button code to viewDidLoad.

I haven't experienced this problem before to know what's going on, so it would be helpful to see the code itself. But I suspect that moving the code to viewDidLoad would solve the problem.

MaxGabriel
  • 7,617
  • 4
  • 35
  • 82
0

When modal View is dismissed, ViewDidLoad is not called, But ViewWillAppear and ViewDidAppear is called, But you say that the code is written in ViewDidAppear, and still it doesnt work. I suggest you to write that code in ViewWillAppear and check.

Ranjit
  • 4,576
  • 11
  • 62
  • 121