当前位置:网站首页>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 {
...
}
边栏推荐
- Larave 自定义公共函数以及引入使用
- 命令执行漏洞
- 真·杂项:资本论阅读笔记(随缘更新)
- (1) the print () function, escape character, binary and character encoding, variables, data type, the input () function, operator
- Basic use of v-on, parameter passing, modifiers
- Shuriken: 1 vulnhub walkthrough
- (4) Function, Bug, Class and Object, Encapsulation, Inheritance, Polymorphism, Copy
- CTF入门之md5
- (不重点考)试算平衡的分类
- 2021-09-04 最简单的Golang定时器应用以及最简单的协程入门儿
猜你喜欢
随机推荐
A code audit notes (CVE - 2018-12613 phpmyadmin file contains loopholes)
命令执行漏洞
快速搭建一个网关服务,动态路由、鉴权的流程,看完秒会(含流程图)
2021-09-04 最简单的Golang定时器应用以及最简单的协程入门儿
PHP deserialization vulnerability
Summary of php function vulnerabilities
CSRF (Cross Site Request Forgery)
CSRF(跨站请求伪造)
v-bind usage: class dynamic binding object array style style and function method
Orasi: 1 vulnhub walkthrough
账务处理程序、记账凭证账务处理程序、汇总记账凭证账务处理程序、科目汇总表账务处理程序、会计信息化概述、信息化环境下会计账务处理的基本要求(此章出1道小题)
The learning path of a network security mouse - the basic use of nmap
Phonebook
After Alibaba Cloud sets up domain name resolution redirection, I cannot use Chrome to access it
php的curl函数模拟post数据提交,速度非常慢
记账凭证的种类、记账凭证的基本内容、记账凭证的填制要求、记账凭证的审核
真·杂项:资本论阅读笔记(随缘更新)
How to log in to Alibaba Cloud server using the admin account
还原最真实、最全面的一线大厂面试题
Alibaba Cloud MySQL 5.7 installation and some major problems (total)









