简体   繁体   English

Android通知栏图标,有没有一种方法可以锁定图标的位置?

[英]Android Notification Bar icon, is there a way to lock the location of the icon?

I currently have a service driven notification appearing. 我目前有一个服务驱动的通知出现。 I am trying to figure out if there is a way to lock the location at which the icon appears. 我试图找出是否有一种方法可以锁定图标出现的位置。 I want to ensure that the icon is always in the same location on the Notification bar, no matter how many notifications appear before or after it. 我想确保该图标始终位于通知栏上的同一位置,而不管它之前或之后出现了多少条通知。 Ideally, I would like to lock it on the right side of the clock and Wifi icons. 理想情况下,我想将其锁定在时钟和Wifi图标的右侧。 I am in Ice Cream Sandwich. 我在冰淇淋三明治中。 Does anyone know if this is possible? 有人知道这是否可能吗? Thanks all. 谢谢大家

First, you cannot control the position of your Notification in the status or system bar, sorry. 首先,抱歉,您无法控制Notification在状态栏或系统栏中的位置。

Second, at least on phones, your Notification will be on the left, away from "the clock and Wifi icons". 其次,至少在电话上,您的Notification位于左侧,远离“时钟和Wifi图标”。

Use the Notification.when propperty. 适当时使用Notification。 You can locate it the first or the last using really high values (long.Max) or really small ones (-long.Max). 您可以使用很高的值(long.Max)或很小的值(-long.Max)找到第一个或最后一个。 But we are allways talking about the left group. 但是我们总是在谈论左派。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM