Android emulator没有检测到正确的屏幕大小?

Android emulator没有检测到正确的屏幕大小?,android,android-layout,android-studio,android-emulator,Android,Android Layout,Android Studio,Android Emulator,我正在创建一个应用程序,它需要不同的屏幕大小布局。我已经搜索了一段时间,已经将屏幕规格添加到我的清单中,并为每个屏幕大小创建了一个不同的布局文件夹 当我使用平板电脑模拟器从android studio运行模拟器时,它会根据需要运行layout xlarge文件。但是,在所有其他情况下,它只运行layout文件 这对我来说是个问题,因为我还需要布局大型文件 我想知道这是否与我的代码有关,或者这是否是一个模拟器问题 编辑: 安卓清单 <?xml version="1.0" encoding="

我正在创建一个应用程序,它需要不同的屏幕大小布局。我已经搜索了一段时间,已经将屏幕规格添加到我的清单中,并为每个屏幕大小创建了一个不同的布局文件夹

当我使用平板电脑模拟器从android studio运行模拟器时,它会根据需要运行
layout xlarge
文件。但是,在所有其他情况下,它只运行
layout
文件

这对我来说是个问题,因为我还需要
布局大型文件

我想知道这是否与我的代码有关,或者这是否是一个模拟器问题

编辑: 安卓清单

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="pckg_name">

<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />

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


<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

</application>

检查模拟设备的大小,请参阅以下内容:

xlarge屏幕至少为960dp x 720dp

大屏幕至少为640dp x 480dp

正常屏幕至少为470dp x 320dp

小屏幕至少为426dp x 320dp

这将确保它使用正确或错误的设置


在android studio中,尝试将
layout
文件夹重命名为
layout normal

,您可以模拟流通中的当前手机。这很好,当我看到模拟器设置中的“屏幕大小”特性时,它会显示“大”然后只读取
layout
文件,而不是
layout large
,但使用平板电脑,它可以工作并读取
layout large
文件平板电脑上方的更正读取正确的
layout xlarge
文件您正在模拟什么设备,您希望提供大的布局?当前正在平板电脑上运行nexus 6.将
布局
更改为
布局正常
没有任何改变。我发布了清单和一个示例xml
layout large
file@phil3992您是否检查了设备的大小,以便您希望正常的设备实际适合正常范围?所以这个答案很有效!我不得不检查屏幕的分辨率,因为android给定的屏幕大小不能完全工作。谢谢你的帮助!
    <RelativeLayout    
  xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@mipmap/background1">


<Button
    android:id="@+id/create_an_account_initial_page"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Large screen"
    android:textSize="17sp"
    android:textStyle="bold"
    android:textColor="@android:color/white"
    android:background="@drawable/button_rectangle_red"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_marginTop="10dp"
    android:layout_marginBottom="31dp"
    android:layout_marginLeft="20dp"
    android:layout_marginRight="20dp"
    android:layout_marginStart="20dp"
    android:layout_marginEnd="20dp"/>



</RelativeLayout>