Android 按键图标不';行不通
我正在为我的软键盘使用以下代码(这是其中的一部分)Android 按键图标不';行不通,android,android-softkeyboard,Android,Android Softkeyboard,我正在为我的软键盘使用以下代码(这是其中的一部分) <Row android:rowEdgeFlags="bottom" > <Key android:codes="83" android:keyLabel="CLR" /> <Key android:codes="39" android:keyLabel="0" /> <Key android:cod
<Row android:rowEdgeFlags="bottom" >
<Key
android:codes="83"
android:keyLabel="CLR" />
<Key
android:codes="39"
android:keyLabel="0" />
<Key
android:codes="42"
style="@style/deleteKeyboard"
android:keyIcon="@drawable/button_delete"
android:isRepeatable="true"
android:keyLabel="DEL" />
</Row>
由于某种原因,样式或键图标无法工作。不管怎样,我不能将键盘上的一个按钮设置为不同的布局。我做错了什么?我试过只使用style和keyIcon,但到目前为止没有任何组合起作用
<style name="deleteKeyboard">
<item name="android:keyTextColor">#EEEEEE</item>
<item name="android:keyBackground">@drawable/button_delete</item>
<item name="android:keyTextSize">15sp</item>
</style>
#Eeeee
@可绘图/按钮\u删除
15便士
事实证明,keyIcon不能与android:keyLabel组合使用。这是我唯一能解决这个问题的方法
<Row android:rowEdgeFlags="bottom" >
<Key
android:keyIcon="@drawable/clear_numeric"
android:codes="83"/>
<Key
android:codes="39"
android:keyLabel="0" />
<Key
android:codes="42"
android:keyIcon="@drawable/delete_numeric"
android:isRepeatable="true"/>
</Row>
delete_numeric和clear_numeric只是带有CLR和DEL的透明PNG(见下文)。要更改这些内容的背景,我必须在
内部使用android:background=“@drawable/numeric\u background”
。这是一个PNG,在这些按钮下面有背景和彩色补丁(您还需要使按钮背景半透明!)。图像的大小无关紧要,因为它会拉伸
- 数字背景.png
- 清除\u numeric.png并删除\u numeric.png