I have a view that contains a TableView , UIImage and a UIButton. The UIButton is configured in the IB and located like this: self.camButton.frame = CGRectMake(0, 410,127,49); My problem is that the UIButton changes its location when I’m poping back to the first ViewController. On first load it’s located fine but when I’m coming back to the ViewController the button is located about 20 pixels up in the view. I’m trying to log the location fo the button so I got inside viewWillAppear:
NSLog(@"Bug Fixes: %f",self.camButton.frame.origin.y); But I’m always getting 410 and 0 on first load and when the button is misplaced. I’m playing around with the
NSLog(@"Bug Fixes: %f",self.view.frame.origin.y);View location in other ViewControllers (while showing keyboard for example I push up the view) but I don’t think that’s what causing it because the view stays in the same location when I’m returning to the first ViewController
I have a view that contains a TableView , UIImage and a UIButton .
Share
you Need to set
autoresizingMaskFor more Information check this link