消息中带有集成按钮的警报对话框
我想在 AlertDialog
(它必须弹出)中执行类似服务条款的操作,用户必须滚动到底部才能看到“接受”或可能伴随的拒绝按钮。有没有办法在 AlertDialog
的 MESSAGE 中包含用户必须滚动浏览的按钮?
类似地,另一种实现就是让按钮无法按下,直到用户滚动到底部,我该怎么做?
洞察力赞赏!
I want to do something like Terms of Service in an AlertDialog
(it must pop up) where the user has to scroll to the bottom to see the "accept" or possible an accompanying decline button. Is there a way to include buttons in the AlertDialog
s MESSAGE that the user must scroll through?
Similarly another implementation would just be to have the button unpressable until the user scrolls to the bottom, how would I do that?
Insight appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想您总是可以创建一个自定义
Dialog
并显示它。 Android 开发者网站上有关于如何执行此操作的指南:http://developer.android.com/guide/topics/ui/dialogs .html#CustomDialog
另一种方法是创建一个具有自己布局的常规类,然后将主题设置为对话框主题。打开时它看起来像一个对话框,并且提供与任何其他
Activity
几乎相同的功能。I suppose you could always create a custom
Dialog
and show that. There's a guide on how to do that on the Android developer site right here:http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog
An alternative would be to create a regular class with its own layout and then set the theme to the dialog theme. This will look like a dialog when opening, and allows for pretty much the same functionality as any other
Activity
.我相信您可以做的是,将对话框中最后一项(即文本视图)的底部位置与 onScrollChanged 侦听器中滚动视图的底部进行比较。这样,当用户到达底部时,您可以调用
I believe what you can do is, compare the bottom position of the last item in the dialog, which would be the textview, to the bottom of the scrollview in the onScrollChanged listener. This way, when the user has reached the bottom, you can call
给你:
显然 msg 包含你的...消息:)
Here you go:
Obviously msg contains your... message :)