В моем приложении я должен расположить два представления по вертикали в соответствии с каждым и хочу убедиться, что они выглядят одинаково на iPhone 4 и 5. Вот код:
nextShowView = [[WestwoodNextShowView alloc]initWithFrame:CGRectMake(-5, 322, 290, 70)];
nextShowView.staticLabel.text = @"Next Show";
nextShowView.date.text = @"10/25";
nextShowView.address.text = @"Green Dot Tavern";
nextShowView.cityState.text = @"Detroit, MI";
[_aboutScroll addSubview:nextShowView];
playerView = [[WestwoodMusicPlayerView alloc]initWithFrame:CGRectMake(0, 407, 320, 50)];
[_aboutScroll addSubview:playerView];
NSDictionary * viewsDict = NSDictionaryOfVariableBindings(nextShowView, playerView);
NSArray * constraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:[nextShowView]-15-[playerView]-20-|" options:NSLayoutFormatAlignAllLeft metrics:nil views:viewsDict];
[_aboutScroll addConstraints:constraints];
То, что я пытался сделать, это дать 15-точечное пространство между nextShowView и playerView и 20-точечное пространство от нижней части playerView до нижнего края представления.
Пожалуйста помоги !!!!
Спасибо,