- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
在新的 Material Design(使用 AppCompat)中,我试图将一些 Action 图标与新工具栏的抽屉图标对齐。像这样的东西:
我认为我正在正确查看所有指标...
问题是我无法完美对齐它,因为在 16px 的左填充之后,图标应该开始,但图标本身也有一些“填充”(来自 Material github 的图标),例如:
也许是愚蠢的,但我不知道我错过了什么。如何考虑图像内的填充以正确对齐它?我在将单选按钮或复选框与该操作栏图标对齐时遇到同样的问题。
我试过这段代码:
<RelativeLayout
android:id="@+id/image_button"
android:layout_width="72dp"
android:layout_height="wrap_content">
<ImageView
android:layout_width="32dp"
android:layout_height="48dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:src="@drawable/ic_label_grey600_48dp" />
</RelativeLayout>
但看起来与我不一致(就像我发布的第一个屏幕截图)。这里看起来也完美对齐:
看起来像是考虑了 72px 和 16px 的填充。
好的,让我给你们看更多的例子和一些代码。假设我的列表项有一个带有标签文本的单选按钮。
<RadioButton
style="?android:textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginLeft="16dp"
android:paddingLeft="32dp"
android:singleLine="true"/>
结果:
在不使用自定义按钮作为单选按钮(并且知道该按钮的尺寸)的情况下,我实际上没有看到将 marginLeft 和 paddingLeft 设置为正确值的规则...... <-- 这是一个糟糕的选择,因为颜色按钮取 self 的 accentColor( Material 的新东西)。
看起来新的 Gmail 应用程序也面临一些对齐问题(看到当我选择一封邮件时,1 不再与邮件标题对齐):
最佳答案
The problem is that I can't perfectly align it, because after that left padding of 16px, the icons should start, but the icon itself has also some "padding" (icon from material github)
是的,图标必须有一些填充,它会根据图标显示的屏幕分辨率而有所不同。不同屏幕密度的填充:
mdpi 4px * 1.0 = 4px
hdpi 4px * 1.5 = 6px
xhdpi 4px * 2.0 = 8px
xxhdpi 4px * 3.0 = 12px
xxxhdpi 4px * 4.0 = 16px
这是可绘制图标中包含的填充,您不应将其删除。
http://www.google.com/design/spec/style/icons.html#icons-system-icons
关于android - 将图标与工具栏图标对齐 - Android Material Design,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26623042/
我正在用power designer创建一个物理模型,我想将默认值添加到我的Mysql表中。 有可能吗,有人加了默认值 ? 谢谢 最佳答案 有可能,我发现“列属性”并不容易 方法如下: 选择表格(单击
关闭。这个问题是 opinion-based 。它目前不接受答案。 想改善这个问题吗?更新问题,以便可以通过 editing this post 用事实和引文来回答。 2年前关闭。 Improve t
我正在编写一个采用 Material Design 布局的应用程序,但找不到任何关于如何将对话框动画显示到屏幕上的指南。 这表明盒子应该只是“砰”的一声存在,但这似乎违背了设计的精神,包括动画和触觉。
我做了一个巨大的掠夺,不小心丢失了我的*.cs(设计文件)..我刚刚得到了*.designer文件。 我能否反过来,仅使用 .designer 文件以某种方式创 build 计文件 (*.cs),还是
如果 Google 的关键字规划器向我显示关键字“Web Design [city-name]”获得约 880 次搜索,而“Website Design [city-name]”获得约 620 次搜索
首先,代码: $(document).ready(function() { $('#member_pattern').hide(); $('.add-member').click(function()
大型软件公司之一问了这个问题。我想出了一个简单的解决方案,我想知道其他人对该解决方案有何看法。 You are supposed to design an API and a backend for
在最新的 Material Design 文档 (https://www.google.com/design/spec/what-is-material/elevation-shadows.html#
背景 我正在对从我们的 RDBMS 数据库到 MongoDB 的转换进行原型(prototype)设计。在进行非规范化时,似乎我有两种选择,一种会导致许多(数百万)个小文档,另一种会导致更少(数十万)
Qt Designer (5.11.2) 在选择 QWebEngineView-Widget 时崩溃。 我正在创建一个对话框,以将其作为 .ui 文件包含在 QGIS 3 中。在表单中,我想使用 QW
我直接从 getmdl.io(组件页面)和所有设备(多台 PC、浏览器、手机等)复制代码,汉堡菜单不在标题中居中。我似乎无法隔离 css 中的菜单图标来重新对齐它。 getmdl.io 上的所有组件代
如何为 SPA 动态初始化 materialize design lite (google) 的组件?当我在 View 中动态初始化组件时,JS 没有初始化。正如我已经尝试过使用 componentH
我正在使用 Angular 4 构建一个 Web 应用程序。对于设计,我使用的是 Material Design lite。但是,我想使用 MDL 实现一个交互式轮播,它给我流畅的外观和感觉,并且与我
它看起来像 Polymer Starter Kit包含比 Material Design Lite 更多的组件,并且现在可用。由于两者都是符合 Material Design 理念的 Google 项
我在设置 mdl-textfield 样式时遇到了一些困难。 具体来说,设置 float 标签的大小和颜色,以及按下输入字段后动画的高度和颜色。 实际上,这是我从组件列表中获取的起点。 https:/
所以,好友列表的现代概念: 假设我们有一个名为 Person 的表。现在,那个 Person 需要有很多伙伴(其中每个伙伴也在 person 类中)。构建关系的最明显方法是通过连接表。即 buddyI
如何在导航中创建子菜单项? Link Link Link Link 我不能用 用它。什么是正确的类? 最佳答案 MDL 似乎还没有原生支持子菜单。 然而
我想知道我应该遵循哪些步骤来解决设计自动售货机等问题并提出许多设计文档(如用例、序列图、类图)。是否有任何我可以阅读的来源/链接,其中讨论了如何逐步进行。 谢谢。 最佳答案 我不确定是否有任何普遍接受
早在 10 月份,Kristopher Johnson 就询问了 Accounting Software Design Patterns 他收到了几个答案,但基本上都是一样的,都指向Martin Fo
我一直在为我们的产品开发一些组件,其中之一是基于流布局面板。 我想做的是为它提供一个自定义设计器,但不会丢失其默认设计器 (System.Windows.Forms.Design.FlowLayout
我是一名优秀的程序员,十分优秀!