Commit 13919577 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

main menu: use floats to configure autolayout and fix rendering issue on iPhones < 6

parent b4bdcfa6
...@@ -80,7 +80,7 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell"; ...@@ -80,7 +80,7 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell";
CGFloat top; CGFloat top;
if (height > screenheight - 20.) { if (height > screenheight - 20.) {
height = screenheight - 20.; height = screenheight - 20.;
top = 10.; top = 20.;
} else } else
top = (screenheight - height) / 2.; top = (screenheight - height) / 2.;
CGFloat left; CGFloat left;
...@@ -112,15 +112,14 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell"; ...@@ -112,15 +112,14 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell";
[self.view addSubview:spacer1]; [self.view addSubview:spacer1];
[self.view addSubview:spacer2]; [self.view addSubview:spacer2];
dict = NSDictionaryOfVariableBindings(_menuTableView, spacer1, spacer2); dict = NSDictionaryOfVariableBindings(_menuTableView, spacer1, spacer2);
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"V:|[spacer1][_menuTableView(==%i)][spacer2(==spacer1)]|", (int)height] options:0 metrics:0 views:dict]]; [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"V:|[spacer1][_menuTableView(==%0.2f)][spacer2(==spacer1)]|", height] options:0 metrics:0 views:dict]];
} else { } else {
dict = NSDictionaryOfVariableBindings(_menuTableView); dict = NSDictionaryOfVariableBindings(_menuTableView);
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"V:|-==%i-[_menuTableView(<=%i)]-==%i-|", (int)top, (int)height, (int)top] options:0 metrics:0 views:dict]]; [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"V:|-==%0.2f-[_menuTableView(<=%0.2f)]-==%0.2f-|", top, height, top] options:0 metrics:0 views:dict]];
} }
dict = NSDictionaryOfVariableBindings(_menuTableView); dict = NSDictionaryOfVariableBindings(_menuTableView);
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"H:|-==%i-[_menuTableView(320)]->=0-|", (int)left] options:0 metrics:0 views:dict]]; [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"H:|-==%0.2f-[_menuTableView(320)]->=0-|", left] options:0 metrics:0 views:dict]];
[_menuTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionTop]; [_menuTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionTop];
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment