Android User Interface的疑惑

shingyuan 2009-08-08 08:37:52
In an Android application, the user interface is built using View and ViewGroup objects. There are many types of views and view groups, each of which is a descendant of the View class.

View objects are the basic units of user interface expression on the Android platform. The View class serves as the base for subclasses called "widgets," which offer fully implemented UI objects, like text fields and buttons. The ViewGroup class serves as the base for subclasses called "layouts," which offer different kinds of layout architecture, like linear, tabular and relative.

A View object is a data structure whose properties store the layout parameters and content for a specific rectangular area of the screen. A View object handles its own measurement, layout, drawing, focus change, scrolling, and key/gesture interactions for the rectangular area of the screen in which it resides. As an object in the user interface, a View is also a point of interaction for the user and the receiver of the interaction events.


以上一段是google官方对android user interface的介绍。

首先看In an Android application, the user interface is built using View and ViewGroup objects.
我的理解是这样的:

用户界面是构建在"View"和"ViewGroup"对象之上的。这里我的疑问是:View 对象是何物?是不是可以这样理解:


class View()
{
//properties
....
//methods
....
}

这只是一个类,按照我对面向对象模糊的认识:应该由这个类生产一个对象

View view = new View();

这样,似乎就做出了一个view对象,不知可否这样理解呢?我觉得这样的理解肯定是不对的。换句话说:这里的“对象”二字该如何解释?
对于"ViewGroup",有着同样的疑惑。
接着往下看:There are many types of views and view groups, each of which is a descendant of the View class.
这句话说的是什么呢?View类的后代有很多类型的"views"和"view groups"?我无法理解。
继续看:View objects are the basic units of user interface expression on the Android platform. The View class serves as the base for subclasses called "widgets," which offer fully implemented UI objects, like text fields and buttons. The ViewGroup class serves as the base for subclasses called "layouts," which offer different kinds of layout architecture, like linear, tabular and relative.
这一段的大概意思是说:View对象是Android平台用户界面的基本单元,“View”类是“widgets”类的基类,基本用来提供界面上的小对象,比如按钮之类的。"ViewGroup"类是"layouts"类的基类,是用来提供布局架构的。不知道对不对,还请各位斧正

接下来看最后一段:

A View object is a data structure whose properties store the layout parameters and content for a specific rectangular area of the screen. A View object handles its own measurement, layout, drawing, focus change, scrolling, and key/gesture interactions for the rectangular area of the screen in which it resides. As an object in the user interface, a View is also a point of interaction for the user and the receiver of the interaction events

我的理解是这样的:“View” 对象是一数据结构:其"properties(性质)"存储“布局”参数。“and content for a specific rectangular area of the screen”这紧接着的一句,我不知是何意。
"A View object handles its own measurement,layout,drawing,focus change, scrolling ...."
这句的意思是否是:"View"对象"handle"(掌管?这里的handle如何理解才合理?)着自己的很多性质“比如 layout,drawing,等等”,最后一句大概是说:View还是用户和事件交互的纽带。

还有一个问题:第二段明明说:"View Class"是负责界面上的小玩意的,比如按钮等等,而“ViewGroup Class”则是负责界面布局的。但第三段中说明了"View object"中的"property"存储了布局参数。这我就不理解了?那还用ViewGroup Class干嘛?

深深感觉小弟理解能力有问题,看Android 的 SDK ,很难理解。
看Android的书,更是不好理解....
这里,请大家帮我看看....谢谢啦
...全文
148 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
LeoTang2 2009-08-09
  • 打赏
  • 举报
回复
哈哈!

以J2ME为例,Button,Image,TextEdit为View,Form为ViewGroup,
ViewGroup为View容器,也是一个View。
zhlwwj1314 2009-08-08
  • 打赏
  • 举报
回复
新玩意儿 顶一下
yubangqi 2009-08-08
  • 打赏
  • 举报
回复
up
内容概要:本文围绕“基于虚拟同步发电机的多逆变器并联改进控制策略”展开,系统研究了微电网环境下多逆变器系统的协同运行与控制问题。重点内容包括虚拟同步发电机(VSG)技术在双机并联系统中的应用,实现有功与无功功率的精确分配(均分或按比例)、微电网黑启动控制、虚拟阻抗的引入以有效抑制环流,以及预同步并网控制策略的设计与实现。文中依托MATLAB/Simulink平台构建了详细的仿真模型,对所提出的各项控制策略进行了全面的仿真验证,确保系统在负载突变、并网/离网切换等动态工况下具备优异的稳定性、动态响应特性和功率均分精度。此外,文档还列举了大量相关的电力系统科研方向与可复现课题,如储能系统优化、无功补偿、配电网重构、智能优化算法应用等,充分体现了MATLAB/Simulink在现代电力电子与新能源并网技术科研中的核心支撑作用。; 适合人群:具备电力电子技术、自动控制原理及微电网基础知识,从事电气工程、新能源发电、智能电网等领域的研究生、科研人员及工程技术人员。; 使用场景及目标:①深入掌握虚拟同步发电机(VSG)在多逆变器并联系统中的功率分配、惯量支撑与一次调频调压机制;②学习并实践微电网黑启动、环流抑制、预同步控制等关键环节的仿真建模与控制算法设计;③借助文中丰富的科研案例与仿真资源,开展高水平学术论文的复现工作或进行创新性课题的研究与开发; 阅读建议:建议结合文中提及的Simulink仿真模型与网盘提供的完整资源,坚持理论学习与动手实践相结合,重点关注控制策略的设计思路、模块化搭建方法及仿真参数的整定过程,同时关注公众号“荔枝科研社”以获取持续的技术支持与资料更新。

13,096

社区成员

发帖
与我相关
我的任务
社区描述
Java J2ME
社区管理员
  • J2ME社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧