4 Imageviews In The Center Like 2 Lines * 2 Rows For All Devices
i'm trying to put 4 imageViews like they was in 2 lines * 2 rows: I did this:
<ScrollViewxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="wrap_content"android:layout_height="wrap_content"android:id="@+id/scroll"><TableLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"><TableRow><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:id="@+id/topLogo1"android:layout_marginTop="5dp"android:src="@drawable/logo_bleu_petit"android:layout_alignParentTop="true"android:layout_centerHorizontal="true" /><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:id="@+id/topLogo2"android:layout_marginTop="5dp"android:src="@drawable/logo_bleu_petit"android:layout_alignParentTop="true"android:layout_centerHorizontal="true" /></TableRow><TableRow><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:id="@+id/topLogo3"android:layout_marginTop="5dp"android:src="@drawable/logo_bleu_petit"android:layout_alignParentTop="true"android:layout_centerHorizontal="true" /><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:id="@+id/topLogo4"android:layout_marginTop="5dp"android:src="@drawable/logo_bleu_petit"android:layout_alignParentTop="true"android:layout_centerHorizontal="true" /></TableRow></TableLayout></ScrollView>
I hope this can fit your question.
Solution 2:
try this one
<LinearLayoutxmlns: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"android:orientation="vertical" ><ImageViewandroid:id="@+id/font"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center_horizontal"android:scaleType="centerCrop"android:src="@drawable/ic_launcher" /><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center"android:orientation="vertical" ><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:gravity="center"android:orientation="horizontal" ><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center_horizontal"android:scaleType="centerCrop"android:src="@drawable/ic_launcher" /><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center_horizontal"android:scaleType="centerCrop"android:src="@drawable/ic_launcher" /></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:gravity="center"android:orientation="horizontal" ><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center_horizontal"android:scaleType="centerCrop"android:src="@drawable/ic_launcher" /><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center_horizontal"android:scaleType="centerCrop"android:src="@drawable/ic_launcher" /></LinearLayout></LinearLayout></LinearLayout>
Post a Comment for "4 Imageviews In The Center Like 2 Lines * 2 Rows For All Devices"