Question

In my viewDidAppear i"m changing the frame of one of my ImageViews. The view and all the other methods will not show it until i will [self viewDidAppear] it. I feel its not right, is there some reloadData message ?

Thank you.

Was it helpful?

Solution

Exactly, calling [self viewDidappear] yourself is not right.

If you need to change the frame of the views while being on the view, create a method yourself that you can call every time you want, or use viewDidLayoutSubviews;

When the bounds change for a view controller’s view, the view adjusts the positions of its subviews and then the system calls this method. However, this method being called does not indicate that the individual layouts of the view’s subviews have been adjusted. Each subview is responsible for adjusting its own layout.

Also, check that your method has a correct implementation:

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

    //Your code
}

OTHER TIPS

It would be better to change your image view's frame in viewDidLayoutSubviews.

You probably implemented the wrong function. The proper method signature is:

- (void)viewDidAppear:(BOOL)animated

not just viewDidAppear.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top