Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • ImageView takes Full Width

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 356
    Comment on it

    Below is the code to adjust ImageView taking full width.

    It is mainly required when we need to show cover photos which take the full width of the screen.

    The images that are in landscape looks ok, but we find a problem with the portrait picture.

    So I define android:adjustViewBounds="true" and android:scaleType="centerCrop" on the xml file.

    Below is the code

       <ImageView
                    android:id="@+id/cover_picture"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:adjustViewBounds="true"
                    android:scaleType="centerCrop"
                    />
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: