控件显示与否属性
- View.VISIBLE
存在且可见。 - View.INVISIBLE
存在但不可见 - View.GONE
不存在
控件属性可以在manifest中以及程序中进行设置。
原始控件显示如下:
- 程序中设置
复制代码
1
2showButton1.setVisibility(View.INVISIBLE);
复制代码
1
2showButton1.setVisibility(View.GONE);
- Manifest中设置
复制代码
1
2
3
4
5
6
7
8<Button android:id="@+id/showButton1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="showButton1" android:visibility="visible" />
最后
以上就是健忘烧鹅最近收集整理的关于Android 控件属性的全部内容,更多相关Android内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复