如何在Android中更改单选按钮的文本颜色?

如何在Android中更改单选按钮的文本颜色?,第1张

概述我想更改单选按钮文本颜色.我试过但它没有更改文本颜色.如何更改单选按钮的文本颜色.可以让我知道如何更改颜色.感谢欣赏. <?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width= 我想更改单选按钮的文本颜色.我试过但它没有更改文本颜色.如何更改单选按钮的文本颜色.可以让我知道如何更改颜色.感谢欣赏.

<?xml version="1.0" enCoding="utf-8"?><relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    androID:layout_wIDth="fill_parent"    androID:layout_height="fill_parent"    androID:background="@androID:color/white"    androID:padding="5dp" >    <ImageVIEw        androID:ID="@+ID/logoKartavya"        androID:layout_wIDth="150dp"        androID:layout_height="40dp"        androID:layout_alignParentleft="true"        androID:layout_alignParenttop="true"        androID:contentDescription="@string/desc"        androID:src="@drawable/logo" />    <tableLayout        androID:ID="@+ID/quizLayout"        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"        androID:layout_below="@+ID/logoKartavya" >        <TextVIEw            androID:ID="@+ID/questiontopic"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_margintop="10dp"            androID:clickable="false"            androID:gravity="center"            androID:textcolor="@androID:color/black"            androID:textSize="18sp"            androID:textStyle="normal|bold" />        <EditText            androID:ID="@+ID/question"            androID:layout_height="wrap_content"            androID:clickable="false"            androID:cursorVisible="false"            androID:editable="false"            androID:lines="3" >            <requestFocus />        </EditText>        <RadioGroup            androID:ID="@+ID/answers"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_margintop="10dp" >            <Radiobutton                androID:ID="@+ID/a0"                androID:layout_wIDth="match_parent"                androID:layout_height="wrap_content"                androID:text="Radiobutton"                androID:textcolor="@androID:color/black" />            <Radiobutton                androID:ID="@+ID/a1"                androID:layout_wIDth="match_parent"                androID:layout_height="wrap_content"                androID:text="Radiobutton"                androID:textcolor="@androID:color/black" />            <Radiobutton                androID:ID="@+ID/a2"                androID:layout_wIDth="match_parent"                androID:layout_height="wrap_content"                androID:text="Radiobutton"                androID:textcolor="@androID:color/black" />            <Radiobutton                androID:ID="@+ID/a3"                androID:layout_wIDth="match_parent"                androID:layout_height="wrap_content"                androID:text="Radiobutton"                androID:textcolor="@androID:color/black" />        </RadioGroup>    </tableLayout>    <linearLayout        androID:ID="@+ID/linearLayout1"        androID:layout_wIDth="fill_parent"        androID:layout_height="wrap_content"        androID:layout_alignParentBottom="true"        androID:orIEntation="horizontal" >        <button            androID:ID="@+ID/Prev"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_weight="0.21"            androID:text="&lt;&lt;" />        <button            androID:ID="@+ID/finish"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_weight="0.18"            androID:text="Finish" />        <button            androID:ID="@+ID/Next"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_weight="0.23"            androID:text=">>" />    </linearLayout></relativeLayout>
解决方法 只需将hedxadecimal颜色代码放入

androID:textcolor="#0000000"
总结

以上是内存溢出为你收集整理的如何在Android中更改单选按钮的文本颜色?全部内容,希望文章能够帮你解决如何在Android中更改单选按钮的文本颜色?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1130092.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存