Code Block - (void)viewDidLayoutSubviews{ [super viewDidLayoutSubviews]; UIButton* button =[[UIButton alloc] initWithFrame:CGRectMake(0, 200, [UIScreen mainScreen].bounds.size.width, 300)]; [button setBackgroundColor:[UIColor orangeColor]]; [button addTarget:self action:@selector(clicked:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:button]; }
I just add a UIButton with 300 height. When I run in iphone 6 plus and iphone XR, the UIButton's height in iphone 6 plus is biggger than in iphone XR. Why?