简体   繁体   English

如何在Xcode故事板中更改预览设备?

[英]How do I change the preview device in Xcode storyboard?

As you can see from the below image 从下图可以看出

在此输入图像描述

The storyboard preview is of some tablet device, I need to change this to the latest iphone or iphone 4s, how can I do this? 故事板预览是一些平板电脑设备,我需要将其更改为最新的iphone或iphone 4s,我该怎么做? Also I know about the assistant editor and how to preview on multiple devices using the assistant editor, thats not what I want, I want to change the preview in the story board itself 我也知道助理编辑器以及如何使用助理编辑器在多个设备上预览,这不是我想要的,我想改变故事板本身的预览

You need to follow four steps. 您需要遵循四个步骤。

  1. Press Cmd + Alt + Enter(return). 按Cmd + Alt + Enter(返回)。 It will show two window. 它会显示两个窗口。
  2. Click on 'Manual' text. 单击“手动”文本。 It will show menu with Last option as 'Preview'. 它会将带有“上一个”选项的菜单显示为“预览”。
  3. Select it. 选择它。

在此输入图像描述

4.Select device type from bottom '+' button into which you want to see preview. 4.从底部的“+”按钮中选择要查看预览的设备类型。 在此输入图像描述

In Xcode 9.2, simply go to your Storyboard and go to the bottom, Click View As and choose a device you like. 在Xcode 9.2中,只需转到Storyboard并转到底部,单击View As并选择您喜欢的设备。 在此输入图像描述

Try this: 尝试这个:

Select view controller > click on attribute inspector > select size you want. 选择视图控制器>单击属性检查器>选择所需的大小。

在此输入图像描述

图片寻求帮助

select any viewController and then in attributes inspector tab you can change size. 选择任何viewController,然后在attributes inspector选项卡中,您可以更改大小。

You can open the utilities view and select the simulated size for the view controller 您可以打开实用程序视图并选择视图控制器的模拟大小

Utitilities View Utitilities查看

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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