如何定制拉丁键盘示例

时间:2013-07-20 08:36:37

标签: android android-keypad android-input-method

我使用拉丁语键盘示例来构建我的自定义键盘。我需要更改字体颜色和键背面颜色。我没有在代码或xml中找到定义颜色的位置。我似乎把它在android键盘类中定义为默认值。如果它可以改变一些帮助。

1 个答案:

答案 0 :(得分:-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`