i want place textview on top right corner of imageview , overlap part of textview on imageview. how can that. right doing this:
<relativelayout android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_marginleft="12dip" > <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imgmessage" android:src="@drawable/listing_message" /> <textview android:id="@+id/tvmessagecounter" android:layout_width="20dip" android:layout_height="20dip" android:padding="2dip" android:text="2" android:textcolor="@drawable/whitecolor" android:background="@layout/bg_blue" android:textsize="10sp" android:gravity="center" android:layout_aligntop="@+id/imgmessage" android:layout_alignparenttop="true" android:layout_alignparentright="true" android:layout_gravity="center_vertical" /> </relativelayout>
if need overlapping should use framelayout.
<framelayout android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_marginleft="12dip" > <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imgmessage" android:src="@drawable/listing_message" /> <textview android:id="@+id/tvmessagecounter" android:layout_width="20dip" android:layout_height="20dip" android:padding="2dip" android:marginleft="10dp" android:text="2" android:textcolor="@drawable/whitecolor" android:background="@layout/bg_blue" android:textsize="10sp" android:gravity="center" android:layout_gravity="center_vertical|right" /> </framelayout>
Comments
Post a Comment