How can I make my custom keyboard transparent?
I want to make soft ke开发者_开发百科yboard background transparent and key buttons semi-transparent.
You can make a custom image for this which has the full keyboard layout. And position the keys accordingly. I did this for one of my projects.
set android:alpha="0.50" in keyboardview of your input.xml
set argb(a=alpha) in android:background="@color/keyboard_background"
The best way to do this would be to set the alpha for the buttons on the keyboard. It would help if we knew if you are making your own keyboard or trying alter the built-in keyboard. Altering the built-in keyboard is out of the range of possibilities, unless you decide to root your device and replace the code for the keyboard with your own. If you are making your own keyboard, the only difference between the regular keyboard and a transparent one is where you set the alpha (transparency) for the buttons and layers.
Here's an example:
<Button android:id="@+id/a"
android:text="@string/a"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:textColor="@color/black"
android:alpha="0.50" ></Button> <!-- 50% transparent -->
精彩评论