android - Center align checkbox in ListView -


i'm trying center align checkbox in listview row.

each listview row comprises of checkbox (left aligned) , 2 rows of text (to right of checkbox).

any ideas on how center checkbox inside row i.e. center between top , bottom dividers opposed top row of text?

my listview layout below reference.

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:paddingtop="5dp" android:paddingbottom="5dp"  >  <checkbox     android:id="@+id/cbboxsl"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_marginleft="5dp"     android:layout_alignparentleft="true"     android:scalex="1.4"     android:scaley="1.4"     android:gravity="center_vertical"       > </checkbox>  <textview     android:id="@+id/tvslitemname"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_torightof="@+id/cbboxsl"     android:layout_marginleft="10dp"     android:layout_alignbaseline="@+id/cbboxsl"     android:textsize="16sp"     android:textcolor="@color/aqua"     android:singleline="true"> </textview>  <textview     android:id="@+id/tv_dateadded"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_below="@+id/tvslitemname"     android:layout_marginleft="10dp"     android:layout_marginright="5dp"     android:layout_margintop="5dp"     android:textsize="12sp"     android:text="added on"     android:textstyle="italic"     android:textcolor="@color/mid_grey"     android:layout_torightof="@id/cbboxsl"     > </textview>  <textview     android:id="@+id/tv_date"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_below="@+id/tvslitemname"     android:layout_torightof="@+id/tv_dateadded"     android:textsize="12dp"     android:textstyle="bold"     android:textcolor="@color/mid_grey"     android:layout_alignbaseline="@+id/tv_dateadded"     /> 

add line checkbox xml.

android:layout_centervertical="true"


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -