当前位置:网站首页>View与ViewGroup
View与ViewGroup
2022-08-02 03:27:00 【m0_63970488】
View是Android所有控件的基类,我们平常所用的TextView和ImageView都是继承View
public class TextView extends View implements ViewTreeObserver.OnPreDrawListener {
...
}
public class ImageView extends View {
....
}
接着看看我们平台常用的布局控件 LinearLayout、它继承自ViewGroup,代码如下所示。
ViewGroup 可以理解为View的组合,它可以包含很多View以及ViewGroup,而它包含的ViewGroup又可以包含View和ViewGroup。以此类推,形成一个View数
public class LinearLayout extends ViewGroup {
...
}
需要注意的是ViewGroup 也继承自View。ViewGroup作为View或者ViewGroup这些组件的容器,派生了多种布局控件子类,比如LinearLayout、RelativeLayout等。一般来说,开发Android应用的用户界面(UI)都不会直接使用View和ViewGroup,而是使用这两大基类的派生类
public abstract class ViewGroup extends View implements ViewParent, ViewManager {
...
}
边栏推荐
猜你喜欢
账务处理程序、记账凭证账务处理程序、汇总记账凭证账务处理程序、科目汇总表账务处理程序、会计信息化概述、信息化环境下会计账务处理的基本要求(此章出1道小题)
The learning path of a network security mouse - the basic use of nmap
File upload vulnerability
SQL注入(7)
Shuriken: 1 vulnhub walkthrough
快速搭建一个网关服务,动态路由、鉴权的流程,看完秒会(含流程图)
SQL注入(6)
Google Hacking
ES6 iterator explanation example
Pycharm packages the project as an exe file
随机推荐
政府会计的概念、政府会计标准体系、政府会计的特点(会形成小考点)、政府会计要素及其确认和计量、政府预算会计要素、政府财务会计要素
CTF introductory notes ping
v-bind usage: class dynamic binding object array style style and function method
Scrapy crawler encounters redirection 301/302 problem solution
CTF入门笔记之ping
记账凭证的种类、记账凭证的基本内容、记账凭证的填制要求、记账凭证的审核
重点考:金融资产概述、交易性金融资产的概念、交易性金融资产的账务处理(取得、持有。出售)、
web渗透必玩的靶场——DVWA靶场 1(centos8.2+phpstudy安装环境)
命令执行漏洞
(6) Design of student information management system
A network security guinea pig's learning path - scripting of advanced usage of nmap
pytorch:保存和加载模型
如何在正则表达式里表达可能存在也可能不存在的内容?
Laravel随笔记录
(2) Sequence structures, Boolean values of objects, selection structures, loop structures, lists, dictionaries, tuples, sets
SATA M2 SSD 无法安装系统的解决方法
ES6 array extension methods map, filter, reduce, fill and array traversal for…in for…of arr.forEach
Syncthing文件同步方案完全攻略(亲测有效)
hackmyvm: controller walkthrough
file contains vulnerabilities