center text and checkmark of CheckedTextView

风流意气都作罢 提交于 2019-12-20 10:44:49

问题


Layout i implemented like below picture :

And code I used is :

 <CheckedTextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/big_green_btn_normal"
        android:checkMark="@drawable/check_circle"
        android:gravity="center_vertical"
        android:text="@string/register_tempClickStaffingAgreement" />

This what i wanted,like the following picture :

Share some idea to customize it but not with custom linear or any other layout..i want a single custom view or checkedTextView...any help would be greatly appreciated.

Thanks..!!


回答1:


Please try below code to implement checkview as you mentioned :

<CheckedTextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/darker_gray"
        android:checkMark="@android:drawable/checkbox_on_background"
        android:gravity="center"
        android:text="Tempclick Staffing Agreement"
        android:textAlignment="gravity" />

Thanks..!!



来源:https://stackoverflow.com/questions/33251242/center-text-and-checkmark-of-checkedtextview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!