巴顿在定制的Android吐司? [英] Button in custom Android Toast?
问题描述
是否有可能在举杯一个按钮?
Is it possible to have a button in a Toast?
在理论上,是因为你可以从XML布局构建自定义敬酒,但我试图把一个按钮,它并不能得到它来注册的点击。 没有人能做到这样的事情?
In theory, yes because you can build a custom Toast from a layout in XML, but I tried to put a button in it and couldn't get it to register the click. Did anyone manage to do something like that?
推荐答案
一个土司不能点击。这是不可能捕捉到的点击里面敬酒消息。 你需要搭建一个对话。看看建立对话框获取更多的信息。
A toast can not be clicked. It is not possible to capture a click inside a toast message. You will need to build a dialog for that. Look at Creating Dialogs for more info.
在吐司类状态的API,举杯将永远不会收到焦点又因为举杯不是认为不存在的onClick消息。我会假设,因此举杯的童车不能点击为好。
The API on the Toast class state that a toast will never receive the focus and because a toast is not a view there is no onClick message. I would assume that therefore childs of a Toast can not be clicked as well.
这篇关于巴顿在定制的Android吐司?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!