如何移动自定义对话框? [英] How to move the custom dialog box?

查看:231
本文介绍了如何移动自定义对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是初学者在机器人。我创建一个自定义对话框,它工作正常。但是这个对话框不会移动。如何将这个自定义对话框。例如,在窗口中含有记事本,画图等,当你点击这个(记事本,画图等),标题栏可以移动的位置。如果可能的话,请发信息如何移动对话框。否则,如果这是不可能的发送理由。请回复您的答案和建议是宝贵的我。谢谢你。

I am beginner in android. I am creating a Custom Dialog box, it is working fine. But this dialog box does not moved. How to move this custom dialog box. For example in windows contains Notepad, Paint, etc. When you click this (Notepad, Paint, etc) title bar you can move the position. If it is possible please send information how to move dialog box. Otherwise if it is not possible send Reason. Please reply your answers and comments are valuable me. Thanks.

推荐答案

对话框没有任何触摸事件侦听器,所以你有可能会创建活动,实施onTouchListener就可以了,并在清单文件

Dialog doesn't have any Touch event listeners so you might possibly create an Activity, implement onTouchListener on it, and in manifest file

<活动机器人:主题=@安卓风格/ Theme.Dialog>

现在你的活动会看起来像一个DialogBox的,并且可以实现视图的 setOnTouchListener()和写入所需的code在监听器。

Now your Activity will look like a DialogBox, and you can implement the view's setOnTouchListener() and write the required code in that listener.

这篇关于如何移动自定义对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆