在Android Studio 1.4.1中使用Nexus 10 emulator忽略布局xlarge
我使用的是Android Studio 1.4.1版 我的布局大目录中有以下两个布局XML: 活动main.xml在Android Studio 1.4.1中使用Nexus 10 emulator忽略布局xlarge,android,android-layout,android-studio,android-emulator,Android,Android Layout,Android Studio,Android Emulator,我使用的是Android Studio 1.4.1版 我的布局大目录中有以下两个布局XML: 活动main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.an
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:fitsSystemWindows="true"
tools:context=".MainActivity">
<android.support.design.widget.AppBarLayout android:layout_height="wrap_content"
android:layout_width="match_parent" android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main" />
<android.support.design.widget.FloatingActionButton android:id="@+id/fab"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin"
android:src="@android:drawable/ic_dialog_email" />
</android.support.design.widget.CoordinatorLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:orientation="horizontal"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_main" tools:context=".MainActivity">
<fragment
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
class="com.hfad.workout.WorkoutListFragment"
android:id="@+id/list_frag"/>
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hfad.workout" >
<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"
android:theme="@style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".DetailActivity"
android:label="@string/title_activity_detail"
android:theme="@style/AppTheme.NoActionBar" >
</activity>
</application>
</manifest>
以下是Android Studio的模拟器详细信息:
Name: Nexus_10_API_23
CPU/ABI: Google APIs Intel Atom (x86)
Path: /Users/rt/.android/avd/Nexus_10_API_23.avd
Target: Google APIs (API level 23)
Skin: nexus_10
SD Card: /Users/rt/.android/avd/Nexus_10_API_23.avd/sdcard.img
Snapshot: no
hw.lcd.density: 320
hw.dPad: no
hw.initialOrientation: landscape
avd.ini.encoding: UTF-8
hw.camera.back: none
disk.dataPartition.size: 200M
hw.gpu.enabled: yes
runtime.network.latency: none
skin.dynamic: yes
hw.keyboard: yes
runtime.network.speed: full
hw.device.hash2: MD5:47dc70fd92541dd16c19f9efa3e9db62
hw.ramSize: 1536
tag.id: google_apis
tag.display: Google APIs
hw.sdCard: yes
hw.device.manufacturer: Google
hw.mainKeys: no
hw.accelerometer: yes
hw.trackBall: no
hw.device.name: Nexus 10
hw.battery: yes
hw.sensors.proximity: no
AvdId: Nexus_10_API_23
hw.sensors.orientation: yes
hw.audioInput: yes
hw.camera.front: none
hw.gps: yes
avd.ini.displayname: Nexus 10 API 23
snapshot.present: no
vm.heapSize: 128
runtime.scalefactor: auto
但是,当我在Nexus 10 emulator中运行我的应用程序时,它使用布局目录中定义的布局,而不是布局xlarge目录。非常感谢您的帮助 我也有这个问题,经过一些研究,我可以说这是android studio的一个已知问题。大型和xlarge布局在预览中(在IDE中)正确显示,但不在模拟器中显示(它采用普通布局xml)。你应该使用真正的手机,但我知道不是每个人都有安卓手机。我通过进入AVD管理器>编辑此AVD>显示高级设置>自定义皮肤定义来解决这个问题
将皮肤从“nexus_10”更改为“无皮肤”使用layout-sw720dp.或layout-sw800dp.谢谢@GabrieleMariotti,虽然不起作用:-(这是正确的答案,nexus_10皮肤(仍然)被窃听
Name: Nexus_10_API_23
CPU/ABI: Google APIs Intel Atom (x86)
Path: /Users/rt/.android/avd/Nexus_10_API_23.avd
Target: Google APIs (API level 23)
Skin: nexus_10
SD Card: /Users/rt/.android/avd/Nexus_10_API_23.avd/sdcard.img
Snapshot: no
hw.lcd.density: 320
hw.dPad: no
hw.initialOrientation: landscape
avd.ini.encoding: UTF-8
hw.camera.back: none
disk.dataPartition.size: 200M
hw.gpu.enabled: yes
runtime.network.latency: none
skin.dynamic: yes
hw.keyboard: yes
runtime.network.speed: full
hw.device.hash2: MD5:47dc70fd92541dd16c19f9efa3e9db62
hw.ramSize: 1536
tag.id: google_apis
tag.display: Google APIs
hw.sdCard: yes
hw.device.manufacturer: Google
hw.mainKeys: no
hw.accelerometer: yes
hw.trackBall: no
hw.device.name: Nexus 10
hw.battery: yes
hw.sensors.proximity: no
AvdId: Nexus_10_API_23
hw.sensors.orientation: yes
hw.audioInput: yes
hw.camera.front: none
hw.gps: yes
avd.ini.displayname: Nexus 10 API 23
snapshot.present: no
vm.heapSize: 128
runtime.scalefactor: auto