Android Nexus 7 平板电脑模拟器无法加载正确的布局文件

标签 android android-layout android-studio android-emulator

我正在编写一个应该同时支持手机和平板电脑的应用。

我创建了 layout-sw600dp layout-large res 下的文件夹, 并且还添加了 support-screensAndroidManifest.xml , 但似乎模拟器总是加载布局文件 activity_main.xmllayout 下文件夹。

    <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"
        android:anyDensity="true"/>

我也找到了一些相关主题,但没有在那里得到答案。

Android Emulator loading wrong layout screen sizes

Why does Android's Nexus 7 virtual device not load my "large" layout resources?

Android stretches the layout file instead of loading the correct file in the res folders

是模拟器的问题还是我需要解决的其他问题?

最佳答案

在开发我的第一个平板电脑应用程序时,我经历了几乎相同的事情。我建议您在 ADV 管理器中编辑您的平板电脑模拟器首选项,并将“高级设置”菜单下的“自定义皮肤定义”设置为“无”。

关于Android Nexus 7 平板电脑模拟器无法加载正确的布局文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32283987/

相关文章:

android - React Native( Intent 重定向修复): What's the equivalent of getCallingActivity() to check for malicious redirection?

android - 将 Android 平台添加到 NetBeans 6.9 时出现问题

android - Listview 在 Android 上禁用内部滚动

android-studio - 如何在 Android Studio 中截取运行 Flutter 应用程序的移动调试设备的屏幕截图?

android - 尝试使用 Delphi 10.4.2 构建 Android 64 位应用程序时出现不兼容的目标链接器错误

android - Clean Architecture 和 Paging 3.0 with Room

android - 我什么时候应该在 android 中使用 9 补丁图像

android-layout - 持续查看 Bottom Sheet 单,覆盖最后一个 RecyclerView 项目

android-studio - Android studio 4.1 - 如何禁用直接在 Android Studio 中运行 Android 模拟器

java - 如何维护自定义 ListView 中每个 EditText 的值