Apply Themes for KeyboardView

I am trying to change the default style for KeyboardView, applying the theme without success. My target SDK is 1.6 and Xperia X10. Can anyone help?

/res/vaules/style.xml:

<style name="myTheme" parent="android:Theme">
  <item name="android:keyboardViewStyle">@style/aa</item>
</style>
<style name="aa" parent="android:Widget.KeyboardView">
  <item name="android:keyTextSize">50sp</item>
  <item name="android:keyTextColor">#FF123456</item>
  <item name="android:keyPreviewHeight">150dp</item>
  <item name="android:labelTextSize">25sp</item>
</style>

Manifest.xml:

<application android:theme="@style/myTheme"
..

The strange thing is that when I apply the style manually in the layout, it works.

+5
source share
1 answer

You do not create KeyboardView like any other component, because keyboard definitions overcome KeyboardView def. Some tips:

Do not worry about the size of the text: the component will find the perfect size so that it fits perfectly into the internal keys.

, xml-. .

, this, , .

0

All Articles