如何使Textview在android中的按钮单击事件中可见 [英] how to make the textview visible in button click event in android

查看:51
本文介绍了如何使Textview在android中的按钮单击事件中可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个简单的应用程序,其中包含一个textview.我的问题是我希望按钮单击事件在此文本视图不可见时可见.

I developed one Simple app, which contains one textview.and my problem is that I want visible in invisible this text view on button click event.

在加载时我这样做

myTextView.setVisible(View.GONE);

然后在按钮单击"事件中执行此操作.

and after this at Button Click event, I do this.

myTextView.setVisible(View.VISIBLE);

textview是可见的,但在TextView下方重叠,表示myTextView不能包含空格.那我现在该怎么办?

The textview is visible but it is overlap on below TextView means myTextView cannot contain space. So what can I do now?

推荐答案

使用

myTextView.setVisible(View.INVISIBLE);

代替

myTextView.setVisible(View.GONE);

在布局中保留空间 .........

to persist the space in layout.........

这篇关于如何使Textview在android中的按钮单击事件中可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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