Saturday, 26 March 2016

XML : margin and layout in android

i wanna create card like pictures, i try to use margin, but not win with this idea. i try create for all element personal view and use paddin or margin but i not have result.

i have code like that

  <RelativeLayout      android:id="@+id/rlCardBlock"      style="@style/Widget.CardContent"      android:layout_width="match_parent"      android:layout_height="wrap_content">          <TextView          android:id="@+id/title"          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:layout_marginTop="24dp"          android:maxLines="2"          android:textStyle="bold"          android:text="title"/>        <TextView          android:id="@+id/content"          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:layout_below="@id/title"          android:maxLines="5"          android:text="content" />        <ImageButton          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:layout_alignParentEnd="true"          android:layout_alignParentRight="true"          android:layout_below="@id/content"          android:layout_marginBottom="8dp"          android:background="@null"          android:src="@drawable/ic_more_vert_black_36dp" />  </RelativeLayout>    

Thank you for your attentions.

No comments:

Post a Comment