xml - Align a RelativeLayout to bottom in android -
i've following code create element of chat, imageview shows unaligned respect design. layout shows this when run program, ¿how can aling view named "avatar" bottom of relativelayout?
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" android:layout_marginleft="@dimen/stixchat_margin_8" android:layout_marginright="@dimen/margin_item_chat_right" android:layout_margintop="@dimen/stixchat_margin_8" > <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/content_avatar" android:orientation="vertical" > <com.trongphuc.emoappchat.friendprofileimageviewlast android:id="@+id/avatar" android:layout_width="62dp" android:layout_height="62dp" android:layout_marginleft="10dp" /> </linearlayout> <relativelayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/bubble_test" android:id="@+id/content_content" > <textview android:id="@+id/content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:layout_marginleft="4dp" android:text="new text" android:linespacingmultiplier="@dimen/chat_text_spacing" android:textappearance="@style/stixchattext.primary.light" android:textcolor="@android:color/white" /> </relativelayout> <imageview android:id="@+id/check" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centervertical="true" android:layout_alignparentleft="true" android:src="@drawable/box_checkk" android:padding="@dimen/stixchat_margin_16"/> <relativelayout android:id="@+id/item_chat_status_root" android:layout_below="@+id/content_content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_torightof="@+id/content_avatar" android:layout_marginleft="@dimen/stixchat_margin_8" android:visibility="gone"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:textsize="10dp" android:text="24/03/2016 @ 20:20" android:id="@+id/item_chat_status_tv" /> </relativelayout> </relativelayout>
relativelayout gives attributes can add in layout xml files.
in case, need add linear layout:
android:layout_alignparentbottom = "true"
this make container align parent's bottom.
you can view documentation here - http://developer.android.com/guide/topics/ui/layout/relative.html
Comments
Post a Comment