安卓:对话:我要隐藏或dimiss [英] Android : Dialog: should I hide or dimiss

查看:135
本文介绍了安卓:对话:我要隐藏或dimiss的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与对话玩弄创建我的应用程序一些快速的意见(如登录时输入的名称等)

I'm playing around with Dialog to create some quick views in my app (like login enter name etc)

和我游荡什么是更好的:隐藏或关闭

and I'm wandering what is better: hide or dismiss.

我知道他们都做,但我一直在游荡,如果这是更好地只是藏在一个对话框,并再次显示它时,我需要或者撤销并重新创建它。

I know what they both do but I keep wandering if it is better to just hide a Dialog and show it again when I need or to dismiss it and recreate it.

我的对话框都很小,都在我的code实际上可以静态的,所以这样我不抱实例吨。

my Dialogs are small and are acutally static in my code so as such I don't hold tons of instances.

所以,有人可以给我用了隐藏解雇的利弊。

So can somebody give me the pros and cons of using hide over dismiss.

杰森

推荐答案

这取决于多少时间你的需要它,如果它是昂贵的创建它。如果不是创建它太贵了,我会亲自preFER将其关闭,有一个干净的环境。但是,如果你不使用数百个对话框,我不认为这真的很重要。

It depends on how many time your need it, and if it is expensive to create it. If it is not too expensive to create it, I would personally prefer to dismiss it, to have a "cleaner environment". But if you're not using hundreds of dialogs, I don't think this really matters.

这篇关于安卓:对话:我要隐藏或dimiss的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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