【问题标题】:Is there a standard button size?有标准的按钮尺寸吗?
【发布时间】:2011-02-04 17:03:40
【问题描述】:

为了便于触摸,按钮是否有最佳实践尺寸(浸入式?)?

【问题讨论】:

    标签: android button


    【解决方案1】:

    请参阅 https://support.google.com/accessibility/android/answer/7101858?hl=en,它说触摸目标应(至少)为 48x48dp


    过时(参见下面的 cmets):Android 设计指南明确指出 48dp 作为任何可触摸对象的建议最小尺寸。见《48dp节奏》:http://developer.android.com/design/style/metrics-grids.html

    【讨论】:

    • 我很困惑,为什么不是48dip。
    • dip 和 dp 是一回事。 dp 正是它在代码/布局中所指的,因为它更短。 dp 仍然发音为“dip”。
    • 该链接现在重定向到一个更通用的页面,没有提及 48dp 或按钮高度。
    【解决方案2】:

    您可能会发现这很有帮助:http://www.lukew.com/ff/entry.asp?1085。大约 8 毫米(50 次倾角)应该没问题。

    【讨论】:

      【解决方案3】:

      看看 Android 按钮设计指南:

      来源:https://material.io/guidelines/components/buttons.html#buttons-style

      【讨论】:

      • 这是可见高度,不包括它周围的填充,它包含在可触摸区域中。他们在链接的文档中多次提到这一点。
      • 已更新链接以获取该图表:Buttons- Material Design- Spec
      【解决方案4】:
      <shape android:shape="rectangle">
                  <corners android:radius="1000dp" />
                  <solid android:color="@color/light_blue" />
                  <stroke android:width="2dip" android:color="#215368" />
                  <padding android:bottom="4dp" android:left="4dp" android:right="4dp" 
                  android:top="4dp" />
      </shape>
      

      此为圆形按钮,请确保宽度和高度相同。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-04-22
        • 1970-01-01
        • 1970-01-01
        • 2019-07-08
        • 1970-01-01
        相关资源
        最近更新 更多