Android 2 Image view with half display in left side and half display in right side -
i drawing linear layout in android display 2 images half image in left side , half image.
i draw :
but want draw below, can please me draw image below.
my layout file here:
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <linearlayout android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignparenttop="true" android:layout_centerhorizontal="true" android:layout_margintop="10dp" android:orientation="vertical" > <linearlayout android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1.5" > <imageview android:id="@+id/sideleft" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1.5" android:layout_marginbottom="10dp" android:background="@drawable/user" android:scaletype="centercrop" /> <imageview android:id="@+id/sideright" android:layout_width="0dp" android:layout_height="match_parent" android:layout_marginleft="1dp" android:layout_weight="1.5" android:layout_marginbottom="10dp" android:background="@drawable/user" android:scaletype="centercrop" /> </linearlayout> </linearlayout> </relativelayout>
that 1 image.
thanks in advance!
you need work on java such output,
set both image fit center, , java set first imageview's right padding -width/2, , second imageview's left padding -width/2. here width imageview's width.
it may you.
Comments
Post a Comment