2

I have a button in my xml layout

         <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"
                     />

and when I set any text on it automatically change to capital letter .even when I set in xml or in fragment.and I dont know what is the problem !!!! I am developing an app for a while but suddenly I faced this problem and it made me confused

mozhi jafr
  • 69
  • 2
  • 10
  • You may also want to consider checking the style that you are using as it might be using a font that is naturally in all caps. – Alexander N. Jul 14 '16 at 12:08

3 Answers3

13

I assume, You using 23 API Level .Its default there. Don't worry.

Just add

android:textAllCaps="false"
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
  • 1
    Thanks a lot you saved my time.but I dont know why it happend becuase I am developping an app and suddenly I faced this problem – mozhi jafr Jul 14 '16 at 12:13
0

use TextView Like this

            <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"
                     />

in this case your text show in small letters

Nitesh Pareek
  • 362
  • 2
  • 10
-1

Programmatically change the transformation method of the button. btn.setTransformationMethod(null);

OR

<style name="MyButton" parent="Widget.AppCompat.Button">
        <item name="android:textAllCaps">false</item>
    </style>
Aditya Vyas-Lakhan
  • 13,409
  • 16
  • 61
  • 96