回答
有針對不同分辨率的設備
1)UI調整3種方法---------------- -----------------第一種方法------------------------------- ------------
-(int)setScreenOf
{
if([self isPad])
{
//return value
//code for ipad
}
else
{
CGRect screenBounds = [[UIScreen mainScreen] bounds];
if (screenBounds.size.height ==568) //height can be dynamic as per device
{
//return value
// code for 4-inch screen
}
else
{ //return value
// code for 3.5-inch screen
}
}
}
2)----------------------------- ------第二種方法-------------------------
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define isiPhone5 ([[UIScreen mainScreen] bounds].size.height == 568)?TRUE:FALSE
you can make different xib for different device and navigate app according to that.
if(IS_IPAD)
{
startVc=[[Start alloc]initWithNibName:@"start_ipad" bundle:nil];
//xib For ipad
}
else
{
if(isiPhone5)
{
startVc=[[Start alloc]initWithNibName:@"start_iphone" bundle:nil];
//xib for iphone5
}
else
{
startVc=[[Start alloc]initWithNibName:@"Start" bundle:nil];
//xib for 3.5 inch device
}
}
nav=[[UINavigationController alloc]initWithRootViewController:startVc];
3)-------- -----------------------------第三米ethod -----------------
您可以使用單一廈門國際銀行鍼對不同的設備,但它會變得複雜而難以管理,如果你的用戶界面包含得多的圖像。
你可以調整你的UI控件或重新大小的控制使用該授權屬性。 您的UI - 控制將如何生效將由它旁邊實施例的窗口中顯示。
- 內在箭頭會讓你的UI控件大大小小按設備 分辨率
- 外界將按住特定 角落中心控制。
你需要兩個設計中的兩個XIB文件中的一個3.5英寸的視網膜(iPhone 4),另一種是4英寸視網膜(iPhone 5),當你調用廈門國際銀行,你需要檢查的條件。
#define isiPhone5 ([[UIScreen mainScreen] bounds].size.height == 568)?TRUE:FALSE
#define isiPhone4 ([[UIScreen mainScreen] bounds].size.height == 480)?TRUE:FALSE
在constant.h文件中定義上述stattement
,然後檢查您的視圖控制器以下條件時,你推或更改視圖 - 控制
if (isiPhone5) // check wheather a phone is iphone 5 or not
{
yourViewController *objyourViewController=[[yourViewController alloc]initWithNibName:@"yourViewController_iphone5" bundle:nil];
[self.navigationController pushViewController:objyourViewController animated:YES];
}
else if (isiPhone4) // check wheather a phone is iphone 4 or not
{
yourViewController *objyourViewController=[[yourViewController alloc]initWithNibName:@"yourViewController_iphone4" bundle:nil];
[self.navigationController pushViewController:objyourViewController animated:YES];
}
我希望這將有助於你
嗨,Maul,我不得不在類或Appdelegate方法中聲明這個東西。 –
在完成所有導入語句後的類中 –
如果要在控制器中添加AppDelegate.h,則仍然可以使用 –
入住廈門國際銀行..
Ø NLY上邊和左邊部分啓用..then嘗試它..
- 1. 從iPhone 4到iPhone 5的屏幕尺寸兼容性問題
- 2. iPhone 4s和iPhone 5的兼容性
- 3. iPhone 4.0兼容性問題
- 4. UIView Iphone 4和Iphone 5中的問題
- 5. iPhone 5和iPhone 4的屏幕問題
- 6. 與iPhone 5兼容的問題
- 7. iPhone 4/iPhone 5在MonoTouch中的用戶界面兼容性
- 8. iPhone 4,iPhone 5,iPhone 3GS兼容的應用程序現在
- 9. 使媒體查詢兼容iPhone 4和iPhone 5
- 10. 位置,使爲iPhone 4和iPhone兼容5
- 11. iPhone兼容性
- 12. iPhone應用程序兼容性問題
- 13. 做的iPhone 5和iPhone 4
- 14. CGRectMake爲iPhone 5和iPhone 4
- 15. 使我的iPhone 5應用程序與iPhone 4,iPod Touch,傳統iPhone兼容?
- 16. iPhone 4和iPhone 5兼容的應用程序 - 故事板或Autolayout?
- 17. iPhone和SDK不同版本的兼容性問題
- 18. iPhone 5和iPhone 4用戶界面問題
- 19. 如何使代碼兼容IOS 5和IOS 4 [iphone]
- 20. iphone 3.5和4問題
- 21. 與iPhone 3G和iPhone 5兼容的應用程序
- 22. iOS 4和iOS 5向後兼容性
- 23. 問題與和iPhone 5
- 24. Iphone 4和iPhone 5的圖像
- 25. iPhone和Android中的圖像兼容性
- 26. iPhone/iPad和Phonegap之間的兼容性
- 27. iPhone 5 uiwebvew問題
- 28. 微分在iPhone 4,iPhone 5和iPad
- 29. 視頻兼容性問題:Android的錄像沒有起到iphone
- 30. iOS應用程序不兼容iPhone 4/4s/5
這個ipad標籤在這裏做什麼???你的問題似乎沒有問你有關ipad的東西嗎? –
[How to develop or migrate apps for iPhone 5 screen resolution?](http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen - 分辨率) –