【问题标题】:How to customized Latin Keyboard example如何自定义拉丁键盘示例
【发布时间】:2013-07-20 08:36:37
【问题描述】:

我正在使用拉丁键盘示例来构建我的自定义键盘。我不需要更改字体颜色和键背景颜色。我没有在代码或 xml 中找到定义颜色的位置。我似乎将其在 android 键盘类中定义为默认值。如果可以进行一些更改,请提供帮助。

【问题讨论】:

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


    【解决方案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`
    

    【讨论】:

    • 这与屏幕键盘的按键无关。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-03-15
    • 2016-04-17
    • 2016-09-14
    • 2022-01-09
    • 1970-01-01
    • 2011-06-06
    • 1970-01-01
    相关资源
    最近更新 更多