Borderless button

来源:互联网 发布:java中数据类型最长 编辑:程序博客网 时间:2024/04/30 04:16

读Google的文档的时候发现的这个,想起来,我之前在即时通讯项目是这样干的,直接在button的xml属性中指定下面的属性:

android:background=null;

One design that can be useful is a "borderless" button. Borderless buttons resemble basic buttons except that they have no borders or background but still change appearance during different states, such as when clicked.

To create a borderless button, apply the borderlessButtonStyle style to the button. For example:

当使用无缝隙的button的时候,当他的state改变的时候,其appearance 回随着其一起改变。

<Button    android:id="@+id/button_send"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:text="@string/button_send"    android:onClick="sendMessage"    style="?android:attr/borderlessButtonStyle" />



获取焦点时:




0 0
原创粉丝点击