本文介绍了安卓:隐藏的ImageView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
IHAVE一个imageveiw intially它应该是在隐藏模式下,
ihave a imageveiw intially it should be in hidden mode ,
<ImageView
android:id="@+id/custom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|right"
android:src="@drawable/custom1" />
和我创建了一个登录页面..whenever我的登录是成功,我应该显示的图像任何建议将helpful..thankyou
and i created a login page ..whenever my login is success i should show the imageAny suggestions will be helpful..thankyou
推荐答案
试试这个
您XML
<ImageView
android:id="@+id/custom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|right"
android:src="@drawable/custom1" />
您可以在这里设置在这样的XML
You can set here on xml like this
android:visibility="visible"
或
android:visibility="invisible"
或
android:visibility="gone"
Java程序
Java program
ImageView imgView = (ImageView)findViewById(R.id.custom);
设置的ImageView
像这样
imgView .setVisibility(View.VISIBLE);
imgView .setVisibility(View.INVISIBLE);
imgView .setVisibility(View.GONE);
区别看不见
和 GONE
。
看不见
- 该部件将是不可见的,但空间小部件会显示
INVISIBLE
- The widget will be invisible but space for the widget will be show.
GONE
- 空间和小部件是不可见的。
GONE
- Both space and widget is invisible.
这篇关于安卓:隐藏的ImageView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!