猿问

android studio 一直在大写我所有的输出消息?

我对这个网站很陌生,所以这只是我在这里的第二个问题。我正在尝试在 Android Studio 上创建一个简单的测验,并且由于某种原因,每个输出似乎都大写了。请帮助我理解为什么以及如何解决这个问题。例如,我所有的输出看起来都是这样的:“A+B”而不是“a+b”,因此它们在数学上是不正确的。


问题库的代码部分:


   private String mQuestions[] =

        {"Prove the simplest form of the following equation:"+expression+"(4n+1)(n+8)-"+expression+"n(4n+1)",

                "A rectangle of sides a"+expressioncube+" and a"+expressionsquare+". Prove its perimeter algebraically",

                "Which of the following represents two consecutive square numbers where n is a positive integer?",

                "For the equation a"+expressionsquare+"=25. The only value that a can hold is 5" ,

                "If my rectangle has a perimeter of 2a+2b , what is its area?"};


    private String mChoices[][] = {

        {"4n+1", "n+1","n+8"},

        {answer2, answer3,answer4},

        {answer5+"and "+expressionsquare+"+2", answer5+"and "+answer6 ,answer5+"and "+answer7},

        {"True", "False","Unsure"},

        {"a+b", "ab","2(a+b)"}};


    private String mCorrectAnswers[] = {"4n+1", answer3 , answer5+"and "+answer7, "False", "ab"};

public String getQuestion (int a){

    String question = mQuestions[a];

    return question;

}


public String getChoice1 (int a){

    String choice0 = mChoices[a][0];

    return choice0;

}

public String getChoice2 (int a){

    String choice1 = mChoices[a][1];

    return choice1;

}


public String getChoice3 (int a){

    String choice2 = mChoices[a][1];

    return choice2;

}

public String getCorrectAnswers (int a){

    String answer = mCorrectAnswers[a];

    return answer;

}

抱歉,如果这不是网站上使用的结构,我仍在学习如何提出问题。


繁星淼淼
浏览 93回答 1
1回答

慕哥6287543

您正在将文本设置在Buttons 上。android中s的默认样式Button是按钮的文本大写。android:textAllCaps="false"您可以使用按钮的默认样式而不是按钮 xml 的属性来摆脱它。
随时随地看视频慕课网APP

相关分类

Java
我要回答