Activity layout android ImageView, ImageButton scaling -
i want achieve of format shown in image. blue part background, image of guy , girl imagebutton. original images these 88x128 (trainer000, trainer001). want rescale imagebutton such image covers entire height , width adjusted accordingly. found 2-3 ways make use of separate class calculate width. want know if there way purely in xml file itself.
what used:
`
<imagebutton android:id="@+id/maleimage" android:layout_width="wrap_content" android:layout_height="fill_parent" android:adjustviewbounds="true" android:scaletype="fitstart" android:layout_alignparentleft="true" android:src="@drawable/trainer000" /> <imagebutton android:id="@+id/femaleimage" android:layout_width="wrap_content" android:layout_height="fill_parent" android:adjustviewbounds="true" android:scaletype="fitstart" android:layout_alignparentleft="true" android:src="@drawable/trainer001" /> <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:layout_centerhorizontal="true" android:textcolor="#000000" android:text="are boy or girl?" android:textappearance="?android:attr/textappearancemedium" />
`
what want this: http://imgur.com/9d6xzut
edit: found solution. used studio's layout editor.
Comments
Post a Comment