Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Layout of my app is ruined when call or hotspot status bar is appear

I have faced a problem while testing my app, everything was perfectly running until I turn on the personal hotspot and the blue bar is appear on the top, all the labels and buttons are moved downward:

enter image description here

Edit: (23-4-2013)

The code of viewDidLoad is:

- (void)viewDidLoad
{
    day1Times = [[NSMutableArray alloc] init];
    day2Times = [[NSMutableArray alloc] init];
    day3Times = [[NSMutableArray alloc] init];
    day4Times = [[NSMutableArray alloc] init];
    day5Times = [[NSMutableArray alloc] init];
    day6Times = [[NSMutableArray alloc] init];
    day7Times = [[NSMutableArray alloc] init];
    [self performSelector:@selector(sendTokenIDSelector) withObject:nil afterDelay:0.1];
    [self performSelectorInBackground:@selector(getTimes) withObject:nil];
    [super viewDidLoad];

}

Edit: (24-4-2013)

The constraints configuration is as following:

enter image description here

How can I fix their location and keep making it not move regardless of the status bar?

like image 618
Mohammed Bujassoum Avatar asked Nov 13 '22 06:11

Mohammed Bujassoum


1 Answers

The problem is due to your views autoresizing mask.You should hook them to the edges so that they won't stretch when the notification occurs.

Open the size inspector using Tools -> Size Inspector or Command+3.

Make sure the strut for the top margin is enabled (indicated by the solid red lines). Thus you can make sure to have the constant margin even when the superview changes.

like image 79
RJR Avatar answered Nov 15 '22 06:11

RJR