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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36418247/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:41:48  来源:igfitidea点击:

How do I change the preview device in Xcode storyboard?

iosxcodexcode-storyboard

提问by Bhargav

As you can see from the below image

如下图所示

enter image description here

在此处输入图片说明

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? 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

故事板预览是某些平板设备的,我需要将其更改为最新的 iphone 或 iphone 4s,我该怎么做?我也知道助理编辑器以及如何使用助理编辑器在多个设备上进行预览,这不是我想要的,我想更改故事板本身的预览

采纳答案by iVarun

Try this:

尝试这个:

Select view controller > click on attribute inspector > select size you want.

选择视图控制器 > 点击属性检查器 > 选择你想要的尺寸。

enter image description here

在此处输入图片说明

回答by girish_pro

You need to follow four steps.

您需要遵循四个步骤。

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

enter image description here

在此处输入图片说明

4.Select device type from bottom '+' button into which you want to see preview. enter image description here

4.从底部的“+”按钮中选择要查看预览的设备类型。 在此处输入图片说明

回答by mwanjajoel

In Xcode 9.2, simply go to your Storyboard and go to the bottom, Click View As and choose a device you like. enter image description here

在 Xcode 9.2 中,只需转到 Storyboard 并转到底部,单击 View As 并选择您喜欢的设备。 在此处输入图片说明

回答by Govind Prajapati

image for help

求助图片

select any viewController and then in attributes inspectortab you can change size.

选择任何 viewController,然后在attributes inspector选项卡中您可以更改大小。

回答by maddy

You can open the utilities view and select the simulated size for the view controller

您可以打开实用程序视图并选择视图控制器的模拟大小

Utitilities View

实用程序视图