3

これは私のレイアウトです:

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

      <SurfaceView android:id="@+id/preview_view"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_centerInParent="true"/>

      <ViewfinderView
            android:id="@+id/viewfinder_view"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="@color/transparent"/>

      <LinearLayout 
            android:id="@+id/result_view"
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="@color/result_view"
            android:visibility="gone"
            android:padding="4dip">

     </LinearLayout>
     <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >

            <ImageView android:id="@+id/App_logo"
                  android:src="@drawable/mylogo"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:layout_weight="1" />

            <TextView android:id="@+id/status_view"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_gravity="bottom|center_horizontal"
                  android:background="@color/transparent"
                  android:text="@string/msg_default_status"
                  android:textColor="@color/status_text"
                  android:textSize="14sp"/>

      </LinearLayout>
</FrameLayout>

問題は、ImageViewの下部にあるXMLが表示されないことです。何か案は?

10倍:)

4

2 に答える 2

1

各ビューには、レイアウトの幅と高さの「fill_parent」のプロパティが含まれています。それらに「wrap_content」を指定するか、正と負のマージンを持つコンテナーに配置する必要があります。そうしないと、すべての使用可能なスペースを占有しようとします。

于 2011-06-10T20:28:33.240 に答える
0

画像ビューから android:layout_weight="1" を削除すると、画像が表示されます。

于 2011-06-10T20:35:46.270 に答える