简体   繁体   中英

How to fit the screen to the window in IOS Simulator

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 !

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