像 Toast 一样在屏幕上显示通知,但可点击。简而言之,“ClickableToast”
我有一个要求,需要在后台线程中的特定事件上在屏幕底部显示一个栏。它还必须是可点击的。
我可以考虑显示吐司,但吐司不可点击。这怎么能做到呢?
我正在2.1上开发
I have a requirement where I need to show a bar at the bottom of the screen on particular event in the background thread. Also it has to be clickable.
I could consider showing a toast but toasts are not clickable. How can this be done?
Im developing on 2.1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
也许它对你有用。
在布局文件中写入此内容
并在包中创建透明面板,
将其设置在您需要的位置。
May be it is useful for you.
in layout file write this
and create TransparentPanel in your package
set this where you need.
您可以显示一个对话框并将 android:background 更改为
android:background="@android:drawable/toast_frame"
如果您想要相同的样式,您可以使用带有 toast 背景的布局,然后应用它使布局从按钮增长的动画。
You can display a dialog and change de android:background to
android:background="@android:drawable/toast_frame"
If you want the same style you can use a layout With the toast's background and then apply it a animation that make the layout grow from button.
我将在当前活动顶部显示一个 PopupWindow 作为通知。通过谷歌找到了它。感谢大家的回复。
I will show a PopupWindow for a notification on top of the current activity. Found it through Google. Thanks to all for your replies.