質問

I have a LinearLayout that is supposed to show vertically an image and 3 Buttons.

However, as soon as I put the image, I can't see the buttons. Is there a logical reason for this behavior ?

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


<ImageView
    android:scaleType="fitStart"
    android:maxHeight="40dp"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:src="@drawable/logooutlast" />

<Button
    android:layout_marginTop="20dp"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/buttonWalktrough" />

<Button
    android:layout_marginTop="20dp"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/buttonFullCompletion" />

<Button
    android:layout_marginTop="20dp"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/buttonInsaneMode" />

</LinearLayout>
役に立ちましたか?

解決

Put ScrollView as the parent view in xml:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

   <LinearLayout
       android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:orientation="vertical" >

       <!-- Other views here -->

   </LinearLayout>

</ScrollView>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top