Reputation: 45
I can't seem to be able to set my imageView
to fill up the whole space (view) of my button. I have button that has a white space as background.
Please take a look at my sample
My code:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom" >
<ScrollView
android:id="@+id/scroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/imageView21"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/bg_shkaf" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
Upvotes: 3
Views: 3721
Reputation: 118
use android:fillViewport="true"
for scroll view and change ImageView
scale type to android:scaleType="fitXY"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom" >
<ScrollView
android:id="@+id/scroll"
android:fillViewport="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/imageView21"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/bg_shkaf" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
Upvotes: 3