Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

IDMah

macrumors 6502
Original poster
May 13, 2011
317
11
Hi all.

Trying to figure out a way to reposition whole.. XIB ..
Just want to move it down 20 or so pixels for iPhone 5, but nothing seems to work. On any plain old view works perfectly..

tried this:
Code:
 - (void)viewDidLoad {
    [super viewDidLoad];
    pageControlBeingUsed = NO;
    NSLog(@"viewDidLoad");
    // reposition iphone models code //
   CGFloat deltaYYMover = 0.0;
   CGRect deltaViewMover = self.view.frame;
    if (IS_IPHONE5) {
        deltaYYMover = 40.0;
        scalYY = SCALEXFOR5;
    }
    
    deltaViewMover.origin.y = deltaViewMover.origin.y + deltaYYMover;
    self.view.frame = deltaViewMover;
   // other stuff ...  
)
Does nothing any ideas?
Thanks.

PS. There is a scrollview and two image views in the XIB
 
Last edited:
Thanks for the hint.. this
Code:
self.view.frame = deltaViewMover
code crashes when in viewDidLayoutSubviews..

So used:
Code:
-(void)viewWillAppear:(BOOL)animated{
    //NSLog(@"ViewDidLayout");
  
    // respoition iphone models code //
    CGFloat deltaYYMover = 0.0;
    CGFloat scalYY = SCALEXFOR35;
    CGRect deltaViewMover = self.view.frame;
    if (IS_IPHONE5) {
    deltaYYMover = DELTAYMOVE;
    scalYY = SCALEXFOR5;
    }
 
    deltaViewMover.origin.y = deltaViewMover.origin.y + deltaYYMover;
    self.view.frame = deltaViewMover;
    //self.view.backgroundColor = [UIColor redColor];
    // Reposition ended //
    
}

Did the trick..
thanks..
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.