Android的 - 单选按钮不显示其Text [英] Android - Radio Button Not Showing its Text

查看:127
本文介绍了Android的 - 单选按钮不显示其Text的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序有一个单选按钮组作为RelativeLayout的一部分。我的问题是,单选按钮不会显示其文本。我得到的是按钮本身。

My app has a radio button group as part of a RelativeLayout. My problem is that the RadioButtons are not showing their text. All I get is the buttons themselves.

下面是XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/setupTabLayout"
    android:scaleType="fitXY"
    android:background="#ffffff" 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent" 
    android:baselineAligned="true" 
    android:orientation="vertical">

    <TextView android:id="@+id/textView1" 
        android:text="Total Points" 
        android:textColor="#000000"
        android:textSize = "30sp"
        android:layout_height="wrap_content" 
        android:layout_width="wrap_content" 
        android:paddingBottom="5px"
        android:layout_gravity="top"
        android:layout_alignParentLeft="true"
        ></TextView>

      <EditText android:id="@+id/editTextTotal" 
        android:text="" 
        android:digits="-0123456789."
        android:windowSoftInputMode="stateVisible"
        android:focusable="true"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:layout_alignTop="@+id/textView1" 
        android:layout_alignBottom="@+id/textView1"
        android:layout_toRightOf="@+id/textView1" 
    ></EditText>

    <RadioGroup android:id="@+id/radioGroup1"  
        android:layout_height="wrap_content" 
        android:layout_width="wrap_content" 
        android:layout_alignParentLeft="true"
        android:layout_above="@+id/textView2"
    > 

        <RadioButton android:id="@+id/radioButton1" 
            android:checked="true" 
            android:text="Points" 
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"  
        ></RadioButton>

        <RadioButton android:id="@+id/radioButton2" 
            android:text="Points" 
            android:layout_height="wrap_content" 
            android:layout_width="wrap_content"
            android:layout_toRightOf="@+id/radioButton1" 
        ></RadioButton>

    </RadioGroup>   

    <TextView android:id="@+id/textView2" 
        android:text="Points Per = " 
        android:textColor="#000000"
        android:textSize = "30sp"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:paddingBottom="5px"
        android:layout_above="@+id/numberPadLayoutContainer"
        android:layout_alignParentLeft="true"
    ></TextView>

    <EditText android:id="@+id/editTextPoints" 
        android:text="" 
        android:digits="-0123456789."
        android:windowSoftInputMode="stateVisible"
        android:focusable="true"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:layout_alignTop="@+id/textView2" 
        android:layout_alignBottom="@+id/textView2"
        android:layout_toRightOf="@+id/textView2" 
    ></EditText>

    <include layout="@layout/numerickeyboard" />

</RelativeLayout>  

任何想法,为什么文本没有显示?

Any ideas why the text isn't showing?

推荐答案

布局背景为白色,也对单选按钮是白色的。它们显示你刚才没有看到他们。

Your Layout background is white and also the texts on the RadioButtons are white. They are displayed you just don't see them.

您可以尝试设置的android:文字颜色=#000来使TE文本黑色

You can try and set android:textColor="#000" to make te texts black.

这篇关于Android的 - 单选按钮不显示其Text的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆