make a 4 rectangle equivalent list on android -


i want implement view image attached.

i have tried create using tablelayout problem items gather together

i try use gridview , wrote adapter problem still exist , items don't locate @ right position , come

my table layout:

<tablelayout     android:id="@+id/mainlay"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     tools:ignore="uselessparent" >      <tablerow         android:layout_width="fill_parent"         android:layout_height="fill_parent"         android:orientation="horizontal" >           <textview             android:id="@+id/main_page_gride_view_adapter_text"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_gravity="center"             android:gravity="center"             android:text="@string/main_page_values_levels"             android:textappearance="?android:attr/textappearancelarge" />          <textview             android:id="@+id/main_page_gride_view_adapter_text1"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_gravity="center"             android:gravity="center"             android:text="@string/main_page_values_estamina"             android:textappearance="?android:attr/textappearancelarge" />     </tablerow>      <tablerow         android:layout_width="fill_parent"         android:layout_height="fill_parent"         android:orientation="horizontal" >          <textview             android:id="@+id/main_page_gride_view_adapter_text2"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_gravity="center"             android:gravity="center"             android:text="@string/main_page_values_speed"             android:textappearance="?android:attr/textappearancelarge" />          <textview             android:id="@+id/main_page_gride_view_adapter_text3"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_gravity="center"             android:gravity="center"             android:text="@string/main_page_values_high_scores"             android:textappearance="?android:attr/textappearancelarge" />     </tablerow> </tablelayout> 

and want this:

enter image description here

thanks in advance

i use weight property linearlayout.   <linearlayout        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:weightsum="2">      <button         android:layout_width="0dp"         layout_gravity="right"         android:layout_height="wrap_content"         android:layout_weight="1"         android:text="1" />      <button         android:layout_width="0dp"         android:layout_height="wrap_content"         layout_gravity="left"         android:layout_weight="1"         android:text="2" />      </linearlayout>     <linearlayout        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:weightsum="2">      <button         android:layout_width="0dp"         android:layout_height="wrap_content"         layout_gravity="right"         android:layout_weight="1"         android:text="3" />      <button         android:layout_width="0dp"         android:layout_height="wrap_content"         layout_gravity="left"         android:layout_weight="1"         android:text="4" />      </linearlayout> 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -