2016-07-14 27 views
1

我在XML佈局按鈕文本會自動切換到大寫字母在android系統

  <Button 
      android:layout_marginTop="10dp" 
      android:layout_marginLeft="30dp" 
      android:layout_marginRight="30dp" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 

      android:text="Default ringtone" 
      android:id="@+id/select_ringtone" 
        /> 

有一個按鈕,當我設置任何文本自動變成大寫字母。甚至當我在XML或片段設置。我不知道什麼是問題!我正在開發一個應用程序一段時間,但突然間我面臨這個問題,它讓我感到困惑

+0

您可能還需要考慮檢查您所使用的樣式它可能使用的字體自然是全部大寫。 –

回答

5

我假設,你使用23 API級別。它默認那裏。 別擔心。

只需添加

android:textAllCaps="false" 
+1

非常感謝您節省了我的時間。但我不知道爲什麼它會發生,因爲我正在開發一款應用程序,並且突然間我遇到了這個問題 –

-1

編程方式更改按鈕的變換方法。 btn.setTransformationMethod(null);

OR

<style name="MyButton" parent="Widget.AppCompat.Button"> 
     <item name="android:textAllCaps">false</item> 
    </style> 
0

使用的TextView喜歡這個

  <TextView 
      android:layout_marginTop="10dp" 
      android:layout_marginLeft="30dp" 
      android:layout_marginRight="30dp" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:text="Default ringtone" 
      android:id="@+id/select_ringtone" 
        /> 

在這種情況下,小寫字母文本顯示