UIView shows perfect on iPhone but not on iPad - ios

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

Related

iPhone application pixelated on iPhone

I've two live apps on Appstore, my one app is looking quite blurry on iPhone 11(which I just bought) and its fine previous models of iPhone, but my another app looks fine on iPhone 11.
The first app which is blurry is built on xib file and base screen size of iPhon SE and second app which look fine is built on storyboard and base screen size is iPhone 8 but I think that may not be the reason.
Blurry App on iPhone 11 (as it look pixelated)
Blurry App on iPhone 8(as it looks fine and crisp)
Xib file of Blurry App
Let me know why this is happening and whats the solution ? Do I need to revamp all screens in project? Looking for suggestions.
Thanks
Finally I found solution and the culprit was iOS 8.0 and Later check. It was unchecked, which I marked checked and added Splash screens for these defined sizes and my whole apps screens became crisp from pixelated.

Unknown padding when using tablet simulator

Why is there a black padding around when running on a tablet simulator? It works fine on iPhones, though.
I think you have made a small mistake. Your project's deployment device is set to iPhone. Just Go to your project's General tab and in Deployment info change device to Universal. Thats it.
It works in iPhone-Mode. You can use iPhone apps on iPad. It just scales to fill screen. If you want your app universal. You should make sure that your layouts work in Any,Any size class. And as #Bhavin Ramani answered, you should set it universal.

iPhone app does not work correctly on iPad after change from universal to iphone only

How can I run iPhone apps on iPad after changing the target from an initial 'Universal' to 'iPhone'?
I'm working on a game for iOS (iPhone) using Swift and SpriteKit. The game got rejected today for this reason:
Reasons for Rejection: 2.10: iPhone apps must also run on iPad without
modification, at iPhone resolution, and at 2X iPhone 3GS resolution
After searching on StackOverflow I found out that it might have something to do with my info.plist file because at first my app was 'universal' and later I've changed it to iPhone-only.
It seems like there's something wrong with the aspect ratio of all the nodes. Take a look at the screenshots below. At the left side is the iPad-simulator and on the right there's the iPhone-simulator.
Maybe the game still thinks it is running on iPad because the nodes appear in 4:3 ratio?
How can I run iPhone apps on iPad after changing the target from an initial 'Universal' to 'iPhone'?
Please help. Thanks!
I've also added a screenshot of my info.plist file.
Apple requires that each app targeted on iPhone should run on iPad in the specific manner.
This usually looks like the app on iPad is not full-screen, it's surrounded by black frame that resembles the situation that the iPad is simulating iPhone.
My suggestion is to use size class now to make the app run full-screen on iPad and this should fix your issue with Apple.
Simply choose in your storyboard Regular Width and Regular Height, delete the existing constraints and set new ones.
More help here and apple docs also might come in handy
Darvydas' comment solved my problem.
What size does your background node have? Also if you whant your app
run only on Landscape delete those 2 (Item 0, Item 1 PORTRAIT)

Make Universal (iPhone+iPad) app run on iPhone storyboard on iPad (simulated size)

I have a universal app that I've previously designed for both iPhone and iPad, now I don't want to work with the iPad storyboard. I know that I can't withdraw iPad support as I've previously published the app as universal. I need to keep my app "Universal" (so that I can update my app without failing verification), but make iPad use the iPhone storyboard in simulation mode. How can I use my iPhone storyboard with iPad in simulation mode? I've deleted the iPad storyboard, and changed the main interface of iPad also to the iPhone storyboard, but now iPad stretches all the view constraints to 768x1024 to fill the screen, giving it an ugly look. I just want to simulate the "iPhone app" (with the 2x button at the corner) but for obvious reasons, I need to keep device mode in "Universal" in project settings. If it's not possible, what is the best practice to programatically limit the whole storyboard to some limited size on the screen to manually make my app run at the same size (or double) of iPhone?
You can't do what you are asking. Once an app is universal it stays universal. You can't suddenly make the app appear to be iPhone-sized on the iPad. The universal app on the iPad will always be full screen. You need to continue properly supported the iPad screen size.
Your only other solution is to create a new iPhone-only app with a new bundle id. Of course this is bad for your existing users.
When you make your app only for iPhone and run it on iPad, there will be 2x scaling button. If you make your app universal, then your view will be stretched on iPad unless you use constraints, or create your screens programmatically regarding iPad and iPhone UI element sizes.

ios app not fitting iphone 5 screen

My ios app does not fit on iphone 5 screen. When I run the app, I can see blank space at the top and bottom of the screen. I have made the app compatible for both iphone sizes. But Since I have updated to the latest xcode, I am facing this issue. See screen shot. Can any one please help?
You probably may not have set your Default-568h image.
On the simulator make sure you have set to iPhone (Retina 4-inch).
You can do this by going simulator menu at the top go to Hardware->Device->iPhone (Retina 4-inch) that will change the phone simulator to the iPhone 5 version.
click here for more get information for naming convention of images [here]Naming convention for iPhone 5 images? [here]
Try setting AutoresizingMask to your container views instead of assigning appFrame.
I have faced the same problem while moving to iOS 7.
Solution comes with AutoresizingMask. iOS 7 has full Screen layout for ViewControllers.

Resources