当前位置:网站首页>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 {
...
}
边栏推荐
猜你喜欢

CTF introductory notes ping

链动2+1模式开发系统

C language uses stack to calculate infix expressions

(7) superficial "crawlers" process (concept + practice)

文件上传漏洞

Smart Tips for Frida Scripting in Kali Environment

Solve the problem that the 5+APP real machine test cannot access the background (same local area network)

清理c盘爆满告急,C盘清理

成本会计的概念、产品成本核算的要求、产品成本核算的对象与成本项目、产品成本的归集和分配(可能考判断)、产品成本计算方法 (三种:产品的品种(品种法),批次(分批法),步骤(分步法))

一个网络安全小白鼠的学习之路——nmap的基本使用
随机推荐
(4) Function, Bug, Class and Object, Encapsulation, Inheritance, Polymorphism, Copy
Smart Tips for Frida Scripting in Kali Environment
利用cookie获取admin权限 CTF基础题
SQL注入(6)
同态加密:CKKS原理之旋转(Rotation)
redis未授权访问(4-unacc)
DNS详解
不懂“赚钱逻辑”,你永远都是社会最底层(广告电商)
The first time to tear the code by hand, how to solve the problem of full arrangement
c语言用栈实现计算中缀表达式
如何一步一步的:玩转全民拼购!
CTF入门笔记之ping
hackmyvm: kitty walkthrough
战场:3(双子叶植物)vulnhub走读
英语每日打卡
ES6 array extension methods map, filter, reduce, fill and array traversal for…in for…of arr.forEach
最简单的FRP内网穿透教程
xxe of CTF
文件上传漏洞
CTF入门笔记之SQL注入