Android Studio仿真器和设计视图屏幕布局不准确

发布于 2025-02-03 11:25:40 字数 468 浏览 5 评论 0原文

我正在与Android Studio和Galaxy Tab A7 Lite合作。

我在屏幕 /活动上有五行文本。

当我在模拟器和/或设计视图中查看屏幕布局(例如文本大小和相对定位)时,它们的布置与实际物理设备屏幕上的布置不同。物理屏幕上的文本更大,因此,它们所占用的整体高度和空间比在物理屏幕上要大于模拟器。

我已经检查了设备管理器中的设置,它们与产品规范匹配:8.7英寸,800 x 1340 MDPI。

还有其他设置可以影响模拟器 /设计视图布局吗?

以下是一些(不是很好的)屏幕截图:设计视图在左侧,右侧的仿真器视图,实际设备屏幕如下:

I am working with Android Studio and with a Galaxy Tab A7 Lite.

I have five lines of text on a screen / activity.

When I view the screen layout (e.g. text sizes and relative positioning) in the emulator and/or in the Design view, they are not laid out the same way as on the actual physical device screen. The texts on the physical screen are bigger etc., and therefore the overall height and amount of space they take up is more on the physical screen than in the emulator.

I have checked the settings in the Device Manager, and they match the product specification: 8.7 inch, 800 x 1340 mdpi.

Is there any other setting that can effect the emulator / design view layout?

Here are some (not very good) screenshots: design view is on the left, emulator view on the right, and actual device screen is below:
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

空心空情空意 2025-02-10 11:25:40

在“查看选项”下,在“显示系统UI”上打勾,以显示系统的顶部动作栏和底部控制栏。
指令的图像

Under "View Options", tick on "Show System UI" to show the system's top Action bar and bottom Control bar.
Image of instructions

小情绪 2025-02-10 11:25:40

我看到可以在这里完成的两件事:

  1. 您可能已经选择了一个没有Topbar
  2. 在您的apptheme中, 模拟器和标签上的颜色变化

I see two things that can be done here:

  1. In your AppTheme you might have selected a theme that does not have a topbar, that is why in the actual tab it takes much screen height
  2. It also looks like your tab is in dark theme that makes the changes in colors on the emulator and the Tab
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文