我是一個較新的iOS應用程序開發。現在我遇到了一個問題,我的應用程序提交。我必須支持iPhone 5上的4英寸顯示器,因爲我的應用程序基於iPhone 4. 我知道我可以重新設計我的視圖框架以匹配4英寸或將像1.187這樣的數字乘以frame.origin。 y支持4英寸。 但我怎麼能以第二種方式做到這一點。 我的代碼是這樣的如何使我的iOS應用程序支持iPhone 5上的4英寸顯示器
if([[UIScreen mainScreen] bounds].size.height == 568){ //to judge if it is 4-inch screen
self.viewController = [[[IPGWViewController alloc] initWithNibName:@"myapp" bundle:nil] autorelease]; //how can I do this here to multiply the number 1.187 to the frame.origin.y
}
else{
self.viewController = [[[IPGWViewController alloc] initWithNibName:@"myapp" bundle:nil] autorelease];
}
非常感謝你!
有沒有辦法在Xcode 4.3中做到這一點? – laiqn
非常感謝! – laiqn