小编use*_*784的帖子

模拟器中的Android平板电脑没有采用正确的布局

我是Android新手,并尝试学习如何使用多个布局文件夹为不同大小的设备指定不同的布局.

我尝试了一些不同的东西,但似乎没有什么能让我的模拟平板电脑使用更大的布局.

我的布局目录结构是:

  • 布局
  • 布局大
  • 布局sw600dp
  • 布局XLARGE

"布局"中的main.xml是

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
        >
    <SearchView android:id="@+id/searchView"
                android:iconifiedByDefault="false"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>

    <FrameLayout
            android:id="@+id/EarthquakeFragmentContainer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

其他三个文件夹中的main.xml是:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:orientation="horizontal">

    <SearchView android:id="@+id/searchView"
                android:iconifiedByDefault="false"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="#FFF"/>

    <fragment android:name="com.paad.earthquake.EarthquakeListFragment"
              android:id="@+id/EarthquakeListFragment"
              android:layout_width="360dp"
              android:layout_height="fill_parent"
            />

    <fragment android:name="com.paad.earthquake.EarthquakeMapFragment"
              android:id="@+id/EarthquakeMapFragment"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
            />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

模拟器设置正在尝试模拟Google Nexus 7:

  • 目标:Google API(API级别16)
  • 皮肤:WXGA800-7in
  • SD卡:16M
  • 我正在使用皮肤附带的所有其他选项,加上hw.keyboard = yes和hw.ramSize = 512

有谁知道为什么这不起作用?

谢谢您的帮助!

android android-emulator android-layout

5
推荐指数
1
解决办法
1405
查看次数

标签 统计

android ×1

android-emulator ×1

android-layout ×1