我正在使用拉丁键盘示例来构建我的自定义键盘。我不需要更改字体颜色和按键背景颜色。我没有在代码或xml中找到定义颜色的位置。我似乎在android键盘类中定义为默认值。如果可以更改一些方式,请提供帮助。
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`