其他分享
首页 > 其他分享> > android-ImageButtons的材质设计指南

android-ImageButtons的材质设计指南

作者:互联网

《材料设计指南》对ImageButton(不是切换按钮)说了什么?

我在这里找不到关于他们的任何信息:https://material.google.com/components/buttons.html.

>他们看起来如何?
>什么时候应该使用它们?
>他们应该如何表现?

示例:我有向左/向右导航按钮来切换日期,我想知道它们是否符合Material Design.

解决方法:

从反编译的ImageButton类的源中找到了这一点.

Displays a button with an image (instead of text) that can be pressed or clicked by the user. By default, an ImageButton looks like a regular {@link android.widget.Button}, with the standard button
background that changes color during different button states. The image on the surface of the button is defined either by the {@code android:src} attribute in the {@code } XML element or by the {@link #setImageResource(int)} method.
To remove the standard button background image, define your own background image or set the background color to be transparent.
To indicate the different button states (focused, selected, etc.), you can define a different image for each state. E.g., a blue image by default, an orange one for when focused, and a yellow one for when pressed. An easy way to do this is with an XML drawable “selector.”

标签:material-design,design-guidelines,android
来源: https://codeday.me/bug/20191026/1938828.html