Notification的icon大小
来源:互联网 发布:手机移动数据自动连接 编辑:程序博客网 时间:2024/06/15 22:34
1Notification的Icon大小问题
问题描述:
我设置notification 的icon为一个png类型图片(大小49*49像素)
当我不设置notification 的tickerText的时候,一切正常。
如图
接下来当设置notification tickerText之后,图片变成大图片 了。如图
上图是当tickerText 信息滚动时候图片变成这样了。
当信息滚动结束后,正常显示了
不知道什么原因导致的?有碰到过得朋友给说下。
一下是显示notification代码 求指点
private void showNotificationOpenDialog(String text){ Notification n = new Notification(); n.icon=R.drawable.icon; n.tickerText=Html.fromHtml(text); n.when=System.currentTimeMillis(); n.flags |= Notification.FLAG_SHOW_LIGHTS; n.flags |= Notification.FLAG_AUTO_CANCEL; n.flags |= Notification.FLAG_ONGOING_EVENT; n.defaults = Notification.DEFAULT_SOUND; Intent i = new Intent(this, DialogActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); Bundle b = new Bundle(); b.putString("content", text); i.putExtras(b); // Simply open the parent activity PendingIntent pi = PendingIntent.getActivity(this, 0, i,0); // Change the name of the notification here n.setLatestEventInfo(this, NOTIF_TITLE, Html.fromHtml(text), pi); mNotifMan.notify(NOTIF_CONNECTED, n); }
参考:
1 图片文件我是新建的文件夹。把图片放到新建的文件夹里。把文件移动到系统默认建立的drawable-hdpi 问题解决!(用ic_launcher验证出现同样的问题,新建文件夹,或移动到drawable-hdpi 文件夹就能解决,我不相信。)
2 对于Notification的Icon来说, 必须要符合Android UI设计规范,如上面的链接,icon大小必须是24*24像素dp,否则,将会出现各种显示不全,图标忽大忽小的现象。(使用这个验证,不出问题了;验证时,发现手机里的LBE的通知图标也是这样大)
0 0
- Notification的icon大小
- ICON的大小
- Notification的图标大小
- launcher/notification icon的尺寸标准
- GetIconInfo获取ICON的大小
- IOS的icon大小总结
- 获取ICON的大小值
- Xcode6 icon大小,LaunchImage的大小
- Notification icon问题
- QMenu上icon的大小设置
- QT 中设置 QMenu的ICON大小
- Android系统的图标设计规范 icon 大小
- Android系统的图标设计规范 icon 大小
- Android系统的图标设计规范 icon 大小
- Android系统的图标设计规范 icon 大小
- Android系统的图标设计规范 icon 大小
- Android系统的图标设计规范 icon 大小
- GetIconInfo函数获取ICON的大小
- Windows下Python包和模块的安装方法
- Git 的 .gitignore 配置
- 每个人都应该知道的14个电脑使用技巧
- Spark使用经验分享
- LeetCode-- Reverse Linked List II
- Notification的icon大小
- spring factory-method
- 一路走来遇到的问题(一)
- 地图实现地点查找和导航
- pt-table-sync修复mysql不一致数据
- OpenGL step by step - tutorial_2 "hello dot"
- Activiti工作流面试相关知识!
- 为什么我要垂直对齐代码(你也要如此!)
- java synchronized详解