J. Joe
J. Joe

Reputation: 381

How to fill full screen of image on xamarin android?

 <FFImageLoading.Views.ImageViewAsync
            android:id="@+id/imgThumbail"
            android:layout_height="500dp"
            android:layout_width="500dp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginBottom="10dp"
            android:layout_marginTop="10dp"
            android:layout_gravity="center_vertical" />

enter image description here I don't want to set 500dp of width, 500dp of height. I want to set full screen of image as above picture.

Upvotes: 0

Views: 1356

Answers (2)

Seasia Creative Crew
Seasia Creative Crew

Reputation: 321

change the properties

android:layout_height="500dp"
android:layout_width="500dp"

to

android:layout_height="match_parent"
android:layout_width="match_parent"

or

android:layout_height="fill_parent"
android:layout_width="fill_parent"

for API level= 8 for below 8

Upvotes: 2

SushiHangover
SushiHangover

Reputation: 74164

Change your 500dp to fill_parent (or wrap_content)

  • wrap_content

The component just want to display big enough to enclose its content only.

  • fill_parent

The component wants to display as big as its parent, and fill in the remaining spaces.

Note: fill_parent was renamed match_parent in API Level 8)

Upvotes: 1

Related Questions