我正在使用Xcode 5构建一个应用程序,并使用视频iPhone 5的图像以及640x960和640x1136的图像。 当我在iPhone 5上运行应用程序时,一切都在增长。 当我在iPhone 4 / 4s上运行时,我的一些按钮丢失似乎是应用程序的大小。 我做错了什么?
以编程方式创建的按钮和代码在这里:
self.questionLabel.text = self.question;
[self.imageView setImage:self.image];
UIImage *normal = [UIImage imageNamed:@"question_button.png"];
UIImage *selected = [UIImage imageNamed:@"question_button_selected.png"];
self.btnOne = [UIButton buttonWithType:UIButtonTypeCustom];
self.btnOne.tag = 1;
[self.btnOne.titleLabel setFont:[UIFont systemFontOfSize:15.0f]];
[self.btnOne setBackgroundImage:normal forState:UIControlStateNormal];
[self.btnOne setBackgroundImage:selected forState:UIControlStateHighlighted];
self.btnTwo = [UIButton buttonWithType:UIButtonTypeCustom];
self.btnTwo.tag = 2;
[self.btnTwo.titleLabel setFont:[UIFont systemFontOfSize:15.0f]];
[self.btnTwo setBackgroundImage:normal forState:UIControlStateNormal];
[self.btnTwo setBackgroundImage:selected forState:UIControlStateHighlighted];
self.btnThree = [UIButton buttonWithType:UIButtonTypeCustom];
self.btnThree.tag = 3;
[self.btnThree.titleLabel setFont:[UIFont systemFontOfSize:15.0f]];
[self.btnThree setBackgroundImage:normal forState:UIControlStateNormal];
[self.btnThree setBackgroundImage:selected forState:UIControlStateHighlighted];
self.btnFour = [UIButton buttonWithType:UIButtonTypeCustom];
self.btnFour.tag = 4;
[self.btnFour.titleLabel setFont:[UIFont systemFontOfSize:15.0f]];
[self.btnFour setBackgroundImage:normal forState:UIControlStateNormal];
[self.btnFour setBackgroundImage:selected forState:UIControlStateHighlighted];
//Assign the frames
_btnOne.frame = [((NSValue *)[indexArray objectAtIndex:0]) CGRectValue];
_btnTwo.frame = [((NSValue *)[indexArray objectAtIndex:1]) CGRectValue];
_btnThree.frame = [((NSValue *)[indexArray objectAtIndex:2]) CGRectValue];
_btnFour.frame = [((NSValue *)[indexArray objectAtIndex:3]) CGRectValue];