Arahim
Arahim

Reputation: 303

iOS - Support xib on iphone 5 Resolution

I have design a view in xib file with 3.5 size. When I run on iphone 5 resolution it show a space in the bottom.

Is there any way to support one xib into both resolution.

Thanks.

EDIT

if( IS_IPHONE_5 )
{
    _helpButton = [[UIButton alloc] initWithFrame:self.view.bounds];
    _LogoImage = [[UIImageView alloc] initWithFrame:self.view.bounds];
    [_helpButton setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
    [_LogoImage setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
    CGRect frameRect = _helpButton.frame;
    frameRect.origin.y += 300;
    _helpButton.frame = frameRect;

}

Upvotes: 1

Views: 1223

Answers (3)

Nikita P
Nikita P

Reputation: 4246

check if you have hardcoded height of your views somewhere

Upvotes: 0

iphonic
iphonic

Reputation: 12719

Its alright that you have xib for 3.5 inch device, don't use AutoLayout if you supporting iOS<6.0.

You have to just set your UIView resize property like below, the app should work properly without any change.

Auto Resize of View

Upvotes: 1

Michael Dautermann
Michael Dautermann

Reputation: 89509

Either 1) turn on Auto Layout for the xib file and let it automatically adjust depending on the screen height or 2) keep Auto Layout off and then set strings and struts to grow the view depending on it's size or 3) use an outlet and programatically set it's height.

Upvotes: 3

Related Questions