Android的自定义键盘颜色,如何更改android软键盘键的背景颜色?

将此行代码添加到input.xml

android:keyBackground="@drawable/samplekeybackground"

所以你的input.xml应该看起来与此类似.

xmlns:android="http://schemas.android.com/apk/res/android"

android:id="@+id/keyboard"

android:layout_alignParentBottom="true"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:keyPreviewLayout="@layout/input_key_preview"

android:keyBackground="@drawable/samplekeybackground"

/>

如果你已经有一个drawable使用很好,否则这里有一个示例关键背景drawable将产生像你的示例图像.

android:state_focused="false"

android:state_selected="false"

android:state_pressed="false"

android:drawable="@drawable/normal" />

android:state_pressed="true"

android:drawable="@drawable/pressed" />

如果你想要xml中的所有内容,你可以使用如下形状xml.

绘制/ normal.xml

和drawable / pressed.xml


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部