user interface - Android: How to embed an Image in another imageview? -
i have air condition image, want show it's brand name(another image) in right top corner, , current temperature (image too) in center. there convenient way implement this?
you can achieve using relativelayout, allows overlays views on each other. can read more relativelayouts here.
this example of how use relativelayout, although have adjust you didn't post of code:
<?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" > <imageview android:id="@+id/image" android:layout_width="30dip" android:layout_height="30dip" android:adjustviewbounds="true" android:scaletype="centercrop" /> <imageview android:id="@+id/image2" android:layout_width="30dip" android:layout_height="30dip" android:adjustviewbounds="true" android:scaletype="centercrop" /> <imageview android:id="@+id/imagef" android:layout_width="100dp" android:layout_height="100dp" android:layout_centerinparent="true" android:background="@drawable/ph_bg" /> </relativelayout>
Comments
Post a Comment