質問

I have a LinearLayout that contains one picture and 3 Buttons.

The picture only takes a small portion of the screen and then they are 3 buttons

The problem is that I have to really scroll down to see the 3 buttons.

The picture is taking so much place.

How can I make it show everything in one screen ?

Here's the code

<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" >

    <ImageView
        android:scaleType="fitXY"
        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>

Here's the current look of my app

Current Look of my app

I want my buttons to appears just below the picture.

Is there a way to resolve this problem ?

役に立ちましたか?

解決

Add this to your imageView to take away space..

android:adjustViewBounds="true"
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top