我拍摄了一个视图并设置了锚点。当我在我的观点中添加时。它们可以在iPhone 5上运行,但它们在iPhone 6和6 Plus中显示出一些优势
@property (strong, nonatomic) IBOutlet UIView *vwTop;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
top= [[NexaTopView alloc]initWithNibName:@"NexaTopView" bundle:nil];
bottom=[[NexaBottomViewViewController alloc]initWithNibName:@"NexaBottomViewViewController" bundle:nil];
[self.vwTop addSubview:top.view];
[self.bottomView addSubview:bottom.view];
[top.txtHeader setText:@"Notifications"];
top.txtHeader.textAlignment=NSTextAlignmentCenter;
}
![enter image description here][1]
但他们显示保证金,请帮助我更新![在ios中输入图像说明] [2]。
答案 0 :(得分:0)
保证金问题可以是自动布局。所以请参考并做到。 用于自动布局.... http://www.raywenderlich.com/83276/beginning-adaptive-layout-tutorial http://www.appcoda.com/introduction-auto-layout/
答案 1 :(得分:0)
尝试使用布局视图,然后在布局视图中添加视图。给予布局视图正确的自动布局约束。