Android 通知操作按钮中图标的大小是多少? [英] What are the sizes of the icons in Android notifications action-buttons?

查看:23
本文介绍了Android 通知操作按钮中图标的大小是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在可扩展通知中:图标应该有什么尺寸(以 dp 为单位)?喜欢这里的小睡和电子邮件图标:

In expandable Notifications: what dimensions (in dp) should the icons have? Like the Icons for Snooze and Email here:

推荐答案

为了澄清这一点,我在 Android 支持库中的 Javadoc 中找到了以下内容:

So to clarify this, I found the following in the Javadoc within the Android support library:

向此通知添加操作.动作通常由系统作为通知内容旁边的按钮.

Add an action to this notification. Actions are typically displayed by the system as a button adjacent to the notification content.

每个动作都必须有一个图标(32dp 正方形并与 Holo Dark动作条视觉风格,一个文本标签,和一个PendingIntent.

Every action must have an icon (32dp square and matching the Holo Dark action bar visual style, a textual label, and a PendingIntent.

展开形式的通知最多可以显示 3 个操作,从按照添加顺序从左到右.行动不会但是,当通知折叠时显示,因此请确保用户可以通过其他方式访问任何基本功能.

A notification in its expanded form can display up to 3 actions, from left to right in the order they were added. Actions will not be displayed when the notification is collapsed, however, so be sure that any essential functions may be accessed by the user in some other way.

所以这些应该与您的操作栏图标相同(对于 Holo Dark 主题),即:

So these should be identical to your action bar icons (for the Holo Dark theme), which is:

资产尺寸:32dp x 32dp
光学方块:24dp x 24dp
颜色(启用):#FFFFFF 80% 不透明度
颜色(禁用):#FFFFFF 30% 不透明度

Asset Size: 32dp x 32dp
Optical Square: 24dp x 24dp
Color (Enabled): #FFFFFF 80% opacity
Color (Disabled): #FFFFFF 30% opacity

这篇关于Android 通知操作按钮中图标的大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆