■ViewGroup容器
1.概述:ViewGroup仿佛是个容器。
2.功能:里面可添加子控件并处理子控件布局。
3.其的属性:
layout_marginBottom 底边向外留空距离 setMargins(int,int,int,int)
layout_marginLeft 左边向外留空距离
layout_marginRight 右边向外留空距离
layout_marginTop 顶边向外留空距离
4.其子控件的属性:—— 属性值:wrap_content / match_parent / fill_parent
layout_width 子控件布局宽度
layout_height 子控件布局高度
5.ViewManger接口:ViewGroup抽象类对其具体实现3个方法:
方法(1).添加子控件addView(...)
方法(2).移除子控件remove(...)
方法(3).更新子控件UpdateViewLayout(...)
1.概述:ViewGroup仿佛是个容器。
2.功能:里面可添加子控件并处理子控件布局。
3.其的属性:
layout_marginBottom 底边向外留空距离 setMargins(int,int,int,int)
layout_marginLeft 左边向外留空距离
layout_marginRight 右边向外留空距离
layout_marginTop 顶边向外留空距离
4.其子控件的属性:—— 属性值:wrap_content / match_parent / fill_parent
layout_width 子控件布局宽度
layout_height 子控件布局高度
5.ViewManger接口:ViewGroup抽象类对其具体实现3个方法:
方法(1).添加子控件addView(...)
方法(2).移除子控件remove(...)
方法(3).更新子控件UpdateViewLayout(...)
本文介绍了Android中ViewGroup容器的基本概念及功能,详细解释了ViewGroup的属性设置方法,包括margin属性和子控件的布局参数。同时,还阐述了ViewGroup接口的实现,包括添加、移除和更新子控件的方法。
409

被折叠的 条评论
为什么被折叠?



