简体   繁体   English

Android LinearLayout没有拉伸全屏

[英]Android LinearLayout not stretching full screen

Hi I'm writing an app for DroidX which is 480x854. 嗨,我正在为DroidX编写一个480x854的应用程序。 I set up my AVD as follows: 我按如下方式设置了AVD:

target:API level 7 目标:API级别7
skin:480x854 皮肤:480X854
hw.lcd.density:160 hw.lcd.density:160

That's it. 而已。 The emulator loads fine and looks great but my app doesn't fill_parent for some reason. 模拟器加载很好,看起来很棒但我的应用程序由于某种原因没有fill_parent。 See here: 看这里:

替代文字

It doesn't scale all the way up and I'm not sure why. 它不会一直向上扩展,我不知道为什么。 Here is my XML: 这是我的XML:

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

<ImageView android:src="@drawable/logo_recruiting"
    android:background="#FF000000" 
    android:adjustViewBounds="true"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"
    android:padding="30dip" />

<LinearLayout android:orientation="vertical"
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"
    android:layout_weight="1" 
    android:gravity="center"
    android:background="@drawable/menu_background">
    <Button android:layout_height="wrap_content"
        android:layout_width="wrap_content" 
        android:layout_marginBottom="25dip"
        android:text="@string/events"
        android:textColor="#FFFFFFFF"
        android:textSize="22dip"
        android:paddingBottom="5dip"
        android:background="@drawable/events_button"
        android:onClick="launchEventsMap"
        android:id="@+id/events_button"
        />
    <Button android:layout_height="wrap_content"
        android:layout_width="wrap_content" 
        android:layout_marginBottom="25dip"
        android:text="@string/jobs"
        android:textColor="#FFFFFFFF"
        android:textSize="22dip"
        android:paddingBottom="5dip"
        android:background="@drawable/jobs_button"
        android:id="@+id/jobs_button"
        />
    <Button android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_marginBottom="25dip" 
        android:text="@string/applicants"
        android:textColor="#FFFFFFFF"
        android:textSize="22dip"
        android:paddingBottom="5dip"
        android:background="@drawable/applicants_button"
        android:id="@+id/applicants_button"
        />
    <Button android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_marginBottom="25dip" 
        android:text="@string/resumes"
        android:textColor="#FFFFFFFF"
        android:textSize="22dip"
        android:paddingBottom="5dip"
        android:background="@drawable/resumes_button"
        android:id="@+id/resumes_button"
        />
    <Button android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_marginBottom="25dip" 
        android:text="@string/settings"
        android:textColor="#FFFFFFFF"
        android:textSize="22dip"
        android:paddingBottom="5dip"
        android:background="@drawable/settings_button"
        android:id="@+id/settings_button"
        />
    </LinearLayout>
</LinearLayout>

this screen resolution would fall into a septate screen size. 此屏幕分辨率将落入隔板屏幕尺寸。 Enable Large or AnyDensity under supported screens in the manifest. 在清单中支持的屏幕下启用Large或AnyDensity。 http://developer.android.com/guide/practices/screens_support.html http://developer.android.com/guide/practices/screens_support.html

我认为这是因为你的ImageView不在LinearLayout ,可能会尝试将整个事物包装在RelativeLayout

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM