0

次のコードでは、最下部の Linear Layout が表示されていません。いくつかの方法を試しましたが、表示できませんでした。ご覧ください。

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

    <include
        android:id="@+id/id_nav_bar"
        layout="@layout/app_nav_layout" />

    <ListView
        android:id="@+id/id_home_screen_list"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:cacheColorHint="@android:color/transparent" />

    <RelativeLayout
        android:id="@+id/id_linear_layout_system_capacity"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="105dip"
        android:background="@drawable/home_storage_bg"
        android:orientation="vertical" >

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_marginTop="40dip"
            android:gravity="center_horizontal"
            android:text="Dummy"
            android:textStyle="bold" />

        <LinearLayout
            android:id="@+id/id_linear_layout_seekbar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:background="@drawable/home_seekbar_bg" />
    </RelativeLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/home_bottom_bg"/ >
    </LinearLayout>
4

3 に答える 3

0

あなたが置いた

android:layout_width="wrap_content" android:layout_height="wrap_content"

wrap_contentとして、レイアウト内にコンテンツがないため、表示されない可能性があります

于 2012-10-08T10:38:53.413 に答える
0

以下のようにコードを編集して問題を修正しました:-

<TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="17dip"
        android:gravity="center_horizontal"
        android:text="Dummy"
        android:textStyle="bold" />
于 2012-10-08T11:52:01.390 に答える
-1

この目に見えないレイアウトは常に画面の下部に表示される必要があることを理解しているので、 このレイアウトを変更するRelativeLayoutinsted を使用することをお勧めしますLinearLayout

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/GlobalBG"
android:orientation="vertical" >

TOして、これを非表示のレイアウトに<RelativeLayout>設定しますandroid:layout_alignParentBottom="true"

編集済み:これは私にとってはうまくいきます

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/red" >

<RelativeLayout
    android:id="@+id/id_linear_layout_system_capacity"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="105dip"
    android:background="@color/row_base_background_end"
    android:orientation="vertical" >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_marginTop="20dip"
        android:gravity="center_horizontal"
        android:text="Dummy"
        android:textStyle="bold" />

    <LinearLayout
        android:id="@+id/id_linear_layout_seekbar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:background="@color/row_base_background_start" />
</RelativeLayout>

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:background="@color/gray" >
</LinearLayout>

</RelativeLayout>
于 2012-10-08T11:01:28.900 に答える