gpt4 book ai didi

android - ImageButton 的 Material Design 指南是什么?

转载 作者:太空宇宙 更新时间:2023-11-03 13:14:12 32 4
gpt4 key购买 nike

Material Design Guidelines 对 ImageButtons(不是切换按钮)有什么看法?

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

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

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

最佳答案

Decompiled 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."

关于android - ImageButton 的 Material Design 指南是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39161657/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com