How to fit the screen to the window in IOS Simulator - ios

I would like to make screenshots of my app in IOS-Simulator. This works fine with CMD-S, but I have always black parts in my screen, because the windows is not autosized to the simulated devices screensize.
Is there a way to autosize the window to fit with the screensize of the simulator ?
Screenshot:
The white part is the content of the device. The black is obsolete and is a window from the MAC. When taking the screenshot from this, I still have to cut out the content to have a good screenshot.

This used to happen in earlier to iOS SDKS when you don't set a launch images for all devices.
In your case, I think you don't have the launch screen file set. this can be solved by setting that file at general section in the target's settings.
Alternatively, set launch screen images for all devices.
Check my answer here.
One more thing to try: At the top bar in simulator. choose the
Window menu then Scale and play with those values.

I solved it the following way, but I don't know what was the reason.
I removed the launchscreen as hasan83 suggested. This did not the trick yet.
I restarted the MAC
I started XCode ("Xcode"->"Open Developer Tools"->"IOS Simulator")
I started the ios simulator without starting my app. -> MAC-Windows fit with the simulated device screen
I started my app and now it looks as intended.
Thanks for helping to all involved people !

Related

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.

Screen content is only shown in a part of screen in iOS Simulator

My iOS Simulator only show the content as a part of the screen. How can I fix it? I'm using XCode 6.3.1. Thanks
You just need to restart it. It can happen sometimes.
Force close simulator and start it again!
I am including this response for those, who like me, are seeking an solution for this problem after upgrading to Xcode 8.
The simulator began using only a portion of the display, as described in the question, when testing against iOS 8.x. The symptoms were that 1/4 of the display was showing if the window scale was set to 50%, 1/9 would show if the scale was set to 33%, etc. The entire display would show only if the scale was set to 100%, which is a real pain when using an iPad simulator.
The solution for me was to turn off "Optimize Rendering for Window Scale" under the "Debug" menu, which first seems to have appeared in Xcode 8. The 8.x simulators displayed properly after that.
Looking at the image..
I think it has something to do with the resolution/scale of the simulator.. I dont use Xcode 6.3.1 though...
since it's 5s the screen resolution/scale is x2.. so instead of 320x568 it must be 640x1136..
why dont you use the device frame rect to fill the screen? something like self.view.frame ?
its hard to guess what causing your problem,show us something that may help.. :)
Visit for more details:
iPhone Simulator Quarter or Top Left part of the screen[Fixed]
Watch the video from this link: iPhone Simulator - Quarter of the screen [Fix]
Step 1: “Force Quit” the iOS Simulator
Step 2: Open “Spotlight Search” and type “Chameleon Wizard” (if you installed Chameleon Bootloader)
Step 3: In that popup window, click on “org.chameleon.Boot”
Step 4: Uncheck display_0, Graphics Mode(Clear that Dropbox also), cpus=1, npci=0x3000, dart=0. Below shows an image with checked items those mentioned here. Just uncheck it all.
Step 5: Restart your Mac and try.

iOS Simulator appears half of desired size

Not sure what happened, but I recently updated Xcode 6, and now the iOS Simulator contents does not fill the whole screen. And yes, I checked window -> scale options.
Click iOS Simulator in the menu bar, then select Reset Content and Settings. I often find that when I update Xcode this is a good idea as problems like yours arise.

iOS8 view is fine but is smaller on iOS7

I am currently working on an iOS application with a Deployment Target of 7.1. Most of my testing has been performed in an iOS8 environment with no issues. I hooked up an iOS7 (5s) test device and found that the view is showing itself as through the phone is a 3.5 (4). I'm not sure what the difference is between iOS7 and iOS8 that would cause this but I can't seem to find a solution. I have rebooted the device, reinstalled the app, and made sure all constraints were set properly in the dev environment. Any ideas?
Thank you in advance.
Use splash screen images not splash screen xib. In my case I have the same problem iOS7 device has black stripe at top and bottom. So I change the settings for splash screen and used images as a splash screen instead of xib and it solved my problem.
Make sure your app has a launch screen for 4" devices. Otherwise it will default to 3.5" devices.
You have to create a LaunchImage in the xcassets file. That will solve your problem.

Black Frame Around iPad Build

I made an iPhone app under universal applications. Deleted the iPad storyboard at the start and added it back in using this answer: Converting Storyboard from iPhone to iPad at a later stage.
Now when I run my iPad build, there seems to be a black border around it.
I've made sure my .plist is using Main_iPad for Main storyboard file base name (iPad).
Found my bug: this is because under Deployment Info in the General tab, I selected only iPhone as my Devices. Changing it to Universal fixed it.
Frankly speaking, this looks like just a scaled-up version of iPhone app. Anyways, to make it work in a better shape you may have to tweak here :
Make sure you have added constraints that actually meeting the iPad size requirements as well. The width & the Heights.
Please provide a launchImage for iPad size. That should solve your problem.
Hope that helps.

Resources