Вопрос

Это моя макет:

<?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не отображается. Любые идеи?

10x :)

Это было полезно?

Решение

Каждый из ваших представлений содержит свойства «fill_parent» для ширины и высот их макета. Вам нужно либо указать для них «wrap_content», либо поместить их в контейнеры с положительными и отрицательными полями, или все они попытаются занять все доступное пространство.

Другие советы

Вам следует удалить Android: Layout_weight = "1" Из изображения и изображения появится изображение.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top