简体   繁体   中英

UIView shows perfect on iPhone but not on iPad

I am pretty new to iOS development and I am able to create views and controllers . I have been testing using my iPhone and other sizes of iPhone and they look great. I tried once on an iPad but it was a border around the screen like in this image. 在此处输入图片说明

I constrained to margins and I did not give any height or width constraints so it could stretch properly. It also looks good on the storyboard viewing so what could I be doing wrong? Can't seem to find any resource online to help.

This is default behaviour when you run iphone app in ipad

This happened because your app is supported iphone only . Tap on your project and select universal if you want to add support for both iphone and ipad.

Other option is you can check requires full screen check box but it will still show black bar

Note: However you are developing iPhone Only app but it is compulsory to check that everything works fine in ipad because apple review team will also check that in ipad and your app may be rejected if something is not proper

在此处输入图片说明

May be you have made an iPhone app. Try to change the setting to Universal app in the xcode settings. Normally iPhone app shows scaled on iPad, which is same as in your case.

Select Projet in xcode -> General Setting

项目设置中的部署信息

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM