Android通知大图尺寸 [英] Android notification big picture dimensions
问题描述
我正在尝试在 Android 通知中找到大图片样式图像的确切尺寸.事实上,我需要这些来以正确的尺寸实时计算图像,以避免在我的应用程序中下载太大.
I'm trying to find the exact dimensions of the big picture style image on Android notification. Indeed, I need those in order to compute images on-the-fly at the right dimensions to avoid too big downloads in my application.
我做了一些测试,例如,我不能将屏幕的宽度作为我的图像的宽度,因为通知中心不完全适合平板电脑的屏幕.
I've made some tests and, for example, I can't take the width of the screen as the width of my image because the notification center does not fit entirely the screen on tablets.
有什么方法可以像我们使用 android.R.dimen.notification_large_icon_width
和 android.R.dimen.notification_large_icon_height
获取大图标那样获得这些尺寸?
Is there any way to get those dimensions as we do for the large icon with android.R.dimen.notification_large_icon_width
and android.R.dimen.notification_large_icon_height
?
谢谢
推荐答案
图片的纵横比应为 2:1,但您的主要内容应比例为 43:24 (~1.79),因为某些设备会超过此宽度.Android 没有大小限制,但请参阅我们的推荐下面的最小、平衡和最大尺寸.
The image should be a 2:1 aspect ratio, but your main content should be in 43:24 ratio (~1.79) as some devices crop past this width. Android does not have a size limit, however see our recommended minimum, balanced, and maximum sizes below.
最小 - 512x256平衡 - 1440x720最大 - 2880x1440
Minimum - 512x256 Balanced - 1440x720 Maximum - 2880x1440
因此,1440x720 似乎是最佳的.
So, 1440x720 seems optimal.
这篇关于Android通知大图尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!