Is there any way to set Button text to capital letter for the first character and all text is cap?
Layout:
<Button
android:id="@+id/q1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13sp"
android:textColor="#ffffff"
android:background="@drawable/ic_btn_q_normal" />
Activity:
final Button q1 = (Button) findViewById(R.id.q1);
q1.setText(answers[numbers.get(0)]);
q1.setOnClickListener(new OnClickListener() {
public void onClick(View v){
q1.setBackgroundResource(R.drawable.ic_btn_q_right);
}
});
answers[numbers.get(0)] is the text that I get from array list.
I have tried with q1.setAllCaps(true); but it's doesn't work for me.
Thanks.