简体   繁体   English

CheckedTextView的中心文本和复选标记

[英]center text and checkmark of CheckedTextView

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. 分享一些想法来定制它,但不是自定义线性或任何其他布局..我想要一个自定义视图或checkedTextView ...任何帮助将不胜感激。

Thanks..!! 谢谢..!!

Please try below code to implement checkview as you mentioned : 如下所述,请尝试以下代码来实现checkview:

<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..!! 谢谢..!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM