android - How to add 3 column in 1 layout? -
first of all, sorry poor english. want design layout. if @ picture below understand saying. in second line, columns dispersed.
i got this:
user user user user user user user user user
i need:
user user user user user user
-
<textview android:layout_width="wrap_content" android:layout_height="match_parent" android:text="test1" android:id="@+id/textview4" android:layout_weight="1" style="@style/dizikanalsüretextviews" /> <textview android:layout_width="wrap_content" android:layout_height="match_parent" android:text="test2" android:id="@+id/textview3" android:layout_weight="1" style="@style/dizikanalsüretextviews" /> <textview android:layout_width="wrap_content" android:layout_height="match_parent" android:text="test3" android:id="@+id/textview2" android:layout_weight="1" style="@style/dizikanalsüretextviews" />
<tablerow android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:text="micheal jackson" android:id="@+id/textview8" android:layout_weight="1" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:text="year 2016" android:id="@+id/textview9" android:layout_gravity="center_vertical" android:layout_weight="1" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:text="new york city" android:id="@+id/textview10" android:layout_gravity="center_vertical" android:layout_weight="1" /> </tablerow> <tablerow android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:text="muhammad ali" android:id="@+id/textview5" android:layout_weight="0.45" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:text="3241" android:id="@+id/textview6" android:layout_gravity="center_vertical" android:layout_weight="1" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:text="londra" android:id="@+id/textview7" android:layout_gravity="center_vertical" android:layout_weight="1" /> </tablerow> <tablerow android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:id="@+id/textview11" android:layout_weight="1" android:text="serena williams" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:text="text here.etc" android:id="@+id/textview12" android:layout_gravity="center_vertical" android:layout_weight="1" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:text="istanbul" android:id="@+id/textview13" android:layout_gravity="center_vertical" android:layout_weight="1" /> </tablerow>
set layout_width="0dp" if want use layout_weight. layout xml can be:
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linearlayout" android:layout_width="match_parent" android:layout_height="27dp" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:layout_marginleft="0dp" android:layout_margintop="0dp" android:weightsum="3" android:orientation="horizontal"> <textview android:id="@+id/textview4" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:text="test1 asdjfga sdfa" /> <textview android:id="@+id/textview3" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:text="test2" /> <textview android:id="@+id/textview2" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:text="test3" /> </linearlayout> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linearlayout2" android:layout_width="match_parent" android:layout_height="27dp" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:layout_marginleft="0dp" android:layout_margintop="0dp" android:weightsum="3" android:orientation="horizontal"> <textview android:id="@+id/textview42" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:text="test1 asdjfga sdfa" /> <textview android:id="@+id/textview32" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:text="test2" /> <textview android:id="@+id/textview22" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:text="test3" /> </linearlayout>
Comments
Post a Comment