如何在Android Studio的布局编辑器中使用自定义分辨率? [英] How to use a custom resolution in Android Studio's layout editor?

查看:663
本文介绍了如何在Android Studio的布局编辑器中使用自定义分辨率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时,我正在编辑列表项或类似的小型UI组件的布局资源.很好,但是Android Studio布局编辑器中可用的屏幕分辨率太大,以至于无法合理了解列表项或外观.即使使用最小的分辨率(2.7英寸QVGQ),也总是会有大量未使用的空间:

Sometimes I'm editing the layout resource for a list item or similar small UI component. This is nice, but the available screen resolutions in the layout editor in Android Studio are all way too big to get a reasonable sense of how the list item or whatever will look. Even when using the smallest resolution available (2.7" QVGQ) there's always a ton of unused space:

如果我尝试使用元素 match_parent match_constraint ,则它们会爆炸,从而占用编辑器的整个空间:

If I try to have elements match_parent or match_constraint then they blow up to take up the entire space of the editor:

如何在Android Studio的布局编辑器中使用自定义屏幕分辨率?这会让我更好地了解这些较小的UI组件布局的实际外观.我的Google搜索都是徒劳的.在Android Studio中,我能够以很小的分辨率添加新的设备定义,但是它没有显示在布局编辑器的可用分辨率列表中.救命!

How can I use custom screen resolutions in Android Studio's layout editor? It would let me get a better idea of how these smaller UI component layouts will actually look. My Google searches have all been futile. Within Android Studio I was able to add a new device definition with a very small resolution, but it doesn't show up in the list of available resolutions in the layout editor. Help!

UPDATE :

UPDATE:

我按照下面Chisko的建议检查了通用电话和平板电脑"菜单,但我的虚拟设备不在那儿.

I checked in the "Generic Phones and Tablets" menu as per Chisko's suggestion below, but my virtual device wasn't there.

但是重新启动Android Studio后,它出现了:

BUT after restarting Android studio, it appeared:

因此Chisko是正确的,但Android Studio中似乎也存在一个错误,直到重新启动后,通用电话和平板电脑"菜单中才会反映出虚拟设备的创建.

So Chisko is right, but there also appears to be a bug in Android Studio where the creation of a virtual device isn't reflected in the "Generic Phones and Tablets" menu until a restart has occurred.

推荐答案

如果添加了自定义设备,请尝试查看通用电话和平板电脑"选项.请参阅屏幕截图:

If you added a custom device try looking on Generic Phones and Tablets option. Refer to screenshot:

这篇关于如何在Android Studio的布局编辑器中使用自定义分辨率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆