android 发通知,如何控制view的高度。

山城忙碌人 2015-06-07 03:58:52
图片一:

图片二:

图片三:


问题描述:
1 我发出通知,需要显示如图片一的内容,实际只显示了图片二,只显示了图片上半部分,下半部分(图片三)未显示,请问是什么原因?
2 请问android如何设置,发出通知后,通知状态栏的高度?需不需要系统权限?


...全文
343 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
haha_321 2015-06-09
  • 打赏
  • 举报
回复
4.1以后的可以用bigContentView,bigContentView = remoteView这样就能够显示更大的通知栏了
山城忙碌人 2015-06-09
  • 打赏
  • 举报
回复
引用 1 楼 lj19851227 的回复:
需要在发通知的时候同时定义两个Notification.Builder,一个是如你图一显示,通知布局为你自定义的RemoteView;一个是如你图二显示,通知使用通知标准布局,他们之间通过 setPublicVersion建立联系。 具体参考Google systemui 关于screenshot 里面通知的处理或是找一个开源的音乐播放器应该实现好了吧 API参考Notification.java /** * Supply a replacement Notification whose contents should be shown in insecure contexts * (i.e. atop the secure lockscreen). See {@link #visibility} and {@link #VISIBILITY_PUBLIC}. * @param n A replacement notification, presumably with some or all info redacted. * @return The same Builder. */ public Builder setPublicVersion(Notification n) { mPublicVersion = n; return this; }
请问有没有现成的例子啊!
山城忙碌人 2015-06-09
  • 打赏
  • 举报
回复
引用 3 楼 haha_321 的回复:
4.1以后的可以用bigContentView,bigContentView = remoteView这样就能够显示更大的通知栏了
你好, 我用的是这个bigcontentview 可是默认是隐藏的,需要点击显示通知,才会显示,请问应该如何解决问题!
KJ_Wang 2015-06-09
  • 打赏
  • 举报
回复
看帮助文档吧!!
peter_nj_RD 2015-06-08
  • 打赏
  • 举报
回复
需要在发通知的时候同时定义两个Notification.Builder,一个是如你图一显示,通知布局为你自定义的RemoteView;一个是如你图二显示,通知使用通知标准布局,他们之间通过 setPublicVersion建立联系。 具体参考Google systemui 关于screenshot 里面通知的处理或是找一个开源的音乐播放器应该实现好了吧 API参考Notification.java /** * Supply a replacement Notification whose contents should be shown in insecure contexts * (i.e. atop the secure lockscreen). See {@link #visibility} and {@link #VISIBILITY_PUBLIC}. * @param n A replacement notification, presumably with some or all info redacted. * @return The same Builder. */ public Builder setPublicVersion(Notification n) { mPublicVersion = n; return this; }

80,472

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧