0

I am using Latin keyboard example to build my custom key board. I need t change the font color and key back ground color. I did not find the place in code or in xml where colors are defined. I seems that its defined in android keyboard class as default. If it can be changes some how pls help.

Sanjay Singh
  • 349
  • 5
  • 18

1 Answers1

-1
go to your xml file. you should be working with something like button within a linearLayout(or may be in a table layout).
so the code should look something like this:

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">

<Button

android:layout_width="wrap_content"
android:layout_height="wrap_content"


*************here your code should look like this ,to color your button"***********

android:text="yourText"

//this line changs the background color
android:background="#888888" //for black or you can use any color in this format.

//this line changes the color of the text on the button
android:textColor="#ffffff"//text appears in white... 


so this is the way you can manipulate your code in xml file...

if you are in java... then, first initialize your all buttons.Then you can edit any color directly from your java code... for examaple


Button btn=(Button) findViewById(R.id.button_1);
btn.setcolor(BLACK);

so,the better way is if you are working with your xml file for customization...
Hope this answers your question.`enter code here`
androCoder-BD
  • 498
  • 7
  • 13