Android background Image to fill screen

前端 未结 3 1426
南旧
南旧 2020-12-08 19:46

How do I get my relative layout to display my image view like this:

\"enter

In

相关标签:
3条回答
  • 2020-12-08 20:11

    Set scalexy = true in ImageView

    0 讨论(0)
  • 2020-12-08 20:12

    Set the ImageView layout parameters to match_parent and set scale type to an appropriate scale type which fulfills your needs:

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:scaleType="centerCrop"
        android:layout_alignParentTop="true" android:src="@drawable/background_race_light"/>
    
    0 讨论(0)
  • 2020-12-08 20:17

    Add a scale type to your imageview. There are several types. The one you need is

    android:scaleType="center"
    

    This page will help explain all the different types.

    0 讨论(0)
提交回复
热议问题