Eclipse Android 布局设计器 - 添加用于预览的新屏幕尺寸

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14731559/
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-19 19:56:59  来源:igfitidea点击:

Eclipse Android layout designer - add new screen sizes for previewing

androideclipseandroid-layouteclipse-adt

提问by Jonathan Wareham

The graphical layout designer in the Eclipse ADT includes the ability to preview how the layout will look on a variety of screen sizes/resolutions. My question - is it possible to add new custom screen sizes to this list, to accommodate new devices when they come out? If so, how?

Eclipse ADT 中的图形布局设计器包括预览布局在各种屏幕尺寸/分辨率上的外观的能力。我的问题 - 是否可以在此列表中添加新的自定义屏幕尺寸,以适应新设备的出现?如果是这样,如何?

回答by f20k

Window -> Android Virtual Device Manager -> Device Definitions Tab -> New Device

窗口 -> Android 虚拟设备管理器 -> 设备定义选项卡 -> 新设备

Once you fill out all the properties, it should be an available option in the layout editor.

填写完所有属性后,它应该是布局编辑器中的一个可用选项。

Edit:Restarting Eclipse/ADT may be required, as mentioned in the comments.

编辑:如评论中所述,可能需要重新启动 Eclipse/ADT。

回答by mirel.cocosila

Yes it is possible and you need to follow the next steps:

是的,这是可能的,您需要按照以下步骤操作:

  1. You start by defining a new device defininitionwith the specs that you want: Windows -> Android Virtual Device Manager -> Device Definitions Tab (New Device);

  2. Then you will see that in your layout editor when choosing the device to render the layout for, you will have 3 categories: Generic, Googleand User

  3. Furthermore, you can add this device to your devices list for layout rendering by using Manual Previewsand Add as thumbnailwhen your device is selected for rendering.

  1. 您首先使用所需的规范定义新的设备定义:Windows -> Android 虚拟设备管理器 -> 设备定义选项卡(新设备);

  2. 然后你会在你的布局编辑器中看到,当你选择要呈现布局的设备时,你将有 3 个类别:GenericGoogleUser

  3. 此外,您可以将此设备添加到您的设备列表以进行布局渲染,方法是在选择您的设备进行渲染时使用手动预览添加为缩略图

回答by Hemant Shori

there is another . just change the device from the xml editor -> generic -> Tablet 7.0 /Tablet 10.0 . that works for me.

还有另一种 。只需从 xml 编辑器 -> generic -> Tablet 7.0 /Tablet 10.0 更改设备。这对我行得通。

回答by Leonardo Sapuy

If you have the new version of the ADT plugin you can't do it, but if your version is other one you can watch this question, it can helps you ScrollView - How to scroll down while designing layout in Eclipse?

如果你有新版本的 ADT 插件你不能这样做,但如果你的版本是另一个你可以看这个问题,它可以帮助你ScrollView - 如何在 Eclipse 中设计布局时向下滚动?