【问题标题】:How much padding should this Activity's root layout have, as per material design specification?根据材料设计规范,这个 Activity 的根布局应该有多少填充?
【发布时间】:2015-09-07 15:23:33
【问题描述】:

我正在尝试模仿this documentation on the specification about the Search pattern in Material Design.中第一张图片中显示的搜索界面

但我找不到任何关于 SearchView 和 Activity 框架边缘之间距离的信息,即应用于 Activity 根布局的padding。

根据 Material Design 规范,我如何确定应该为 Activity 的根布局应用多少填充?

我尝试过的:

在this specification of Metrics and Keylines,尤其是this image,他们显示了paddingLeft 的16dp,但是下图中应用的填充似乎没有16dp,Google Now 应用也没有,其实这个padding,也就是下图中应用的那个,无非就是像8dp。

【问题讨论】:

  • 有人投了反对票。如果能告诉我原因,我将不胜感激?我在细节上太过分了吗?我走错方向了吗?

标签: android material-design


【解决方案1】:

虽然不是严格特定于 Material Design,但 @dimen/activity_vertical_margin 在 Android 应用程序中通常定义为 16dp。

这通常用于许多应用程序和设计指南。

应该注意,根据 Material Design 指南,水平边距确实因屏幕尺寸而异。

res/values/dimens.xml 通常指定:

<dimen name="activity_horizontal_margin">16dp</dimen>

虽然您通常会在平板设备上看到 res/values-w820dp/dimens.xml,但指定:

<dimen name="activity_horizontal_margin">64dp</dimen>

【讨论】:

    猜你喜欢
    • 2020-06-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-02
    • 1970-01-01
    • 2022-12-20
    • 1970-01-01
    相关资源
    最近更新 更多