user717452
user717452

Reputation: 111

UIButton Not Hiding

I use IB and have properly wired up my buttons. I have verified they are properly wired, as some IBAction methods will have buttons hide properly. The issue I have is hiding the UIButtons when it first loads the app. In viewDidLoad I set the button property to hidden, but it doesn't hide it. Thoughts?

- (void)viewDidLoad {
    stop.hidden = YES;
    play.hidden = YES;

    [activity startAnimating];

    [super viewDidLoad];
}

After more debugging, the stop button hides but not the play.

Upvotes: 1

Views: 1485

Answers (2)

Lithu T.V
Lithu T.V

Reputation: 20021

Try this

  • Remove outlet run the code ,test weather it works fine
  • Remove outlet,add hidden property via IB and run it again and test if it is seen properly.

If it works fine the problem is with code written.

  • Check the hidden property written via code

Upvotes: 0

shannoga
shannoga

Reputation: 19869

It's hard to tell even from the code you posted why this is happening, The best guess will be that somewhere in the next lines of code you set it back to visible = YES mistakably. I would check if there is a method that shows the button that is called before it is needed.

BUT

If the initial state is hidden for your buttons. why don't you simply hide them on IB interface?

Upvotes: 1

Related Questions