Android 应用程序 - 如何设置 OpenFeint 通知位置
我已将 OpenFeint 集成到我的 Android 游戏中,但分数发布和成就解锁通知会自动显示在屏幕底部。
我如何手动设置该通知在屏幕上的位置?我想将其显示在屏幕顶部。
I've Integrated OpenFeint in my android game but the score-post and achievement unlock notification is shown at bottom of the screen automatically.
how can i manually set the location of the that notification on my screen.? I want to show it to the top of the screen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
OpenFeint 示例代码使用 Toast 类来显示这些通知。您可以轻松地将该代码调整为几乎任何您想要的内容。
编辑:我意识到您可能指的是来自底部的通知,在这种情况下,您需要编写一个扩展 com.openfeint.api.Notification.Delegate 的类并显示您自己的设计。不幸的是 OpenFeint 不提供默认通知类的参数。
The OpenFeint sample code uses the Toast Class to display those notifications. You can easily adjust that code to almost anything you want.
edit: I realize that you might mean the notification that comes from the bottom, in which case you will need to write a class extending
com.openfeint.api.Notification.Delegate
and display your own design. Unfortunately OpenFeint doesnt provide parameters on the default notification class.您可以通过编辑NotificationBase.java 文件轻松地将其显示在屏幕顶部。它位于 com.openfeint.internal.notifications 中。只需查找 showToast() 方法并对其进行编辑即可。将 Gravity.BOTTOM 更改为 Gravity.TOP。看看下面:
You can easily show it at the top of the screen by editing the NotificationBase.java file. It is located in com.openfeint.internal.notifications. Just look for the showToast() method, and edit it. Change Gravity.BOTTOM to Gravity.TOP. Check it out below: