android上的view的类叫View,

以下是它的class overview,

This class represents the basic building block for user interface components. A View occupies a rectangular area on the screen and is responsible for drawing and event handling. View is the base class for widgets, which are used to create interactive UI components (buttons, text fields, etc.). The  ViewGroup subclass is the base class for layouts, which are invisible containers that hold other Views (or other ViewGroups) and define their layout properties.

根据以上说明,可以看出,ViewGroup类才能添加子view,View类本身不提供添加子view的功能。

ios上的view的类叫UIView,

以下是它的class overview,

The UIView class defines a rectangular area on the screen and the interfaces for managing the content in that area. At runtime, a view object handles the rendering of any content in its area and also handles any interactions with that content. The UIView class itself provides basic behavior for filling its rectangular area with a background color. More sophisticated content can be presented by subclassing UIView and implementing the necessary drawing and event-handling code yourself. The UIKit framework also includes a set of standard subclasses that range from simple buttons to complex tables and can be used as-is. For example, a UILabel object draws a text string and a UIImageView object draws an image.

Because view objects are the main way your application interacts with the user, they have a number of responsibilities. Here are just a few:

  • Drawing and animation

    • Views draw content in their rectangular area using technologies such as UIKit, Core Graphics, and OpenGL ES.

    • Some view properties can be animated to new values.

  • Layout and subview management

    • A view may contain zero or more subviews.

    • Each view defines its own default resizing behavior in relation to its parent view.

    • A view can define the size and position of its subviews as needed.

  • Event handling

    • A view is a responder and can handle touch events and other events defined by the UIResponder class.

    • Views can use the addGestureRecognizer: method to install gesture recognizers to handle common gestures.

Views can embed other views and create sophisticated visual hierarchies. This creates a parent-child relationship between the view being embedded (known as the subview) and the parent view doing the embedding (known as the superview). Normally, a subview’s visible area is not clipped to the bounds of its superview, but in iOS you can use the clipsToBounds property to alter that behavior. A parent view may contain any number of subviews but each subview has only one superview, which is responsible for positioning its subviews appropriately.

根据以上说明,iso的view具有添加subView的功能。

仔细对比阅读以上overview,可以更加明确它们之间的区别。

android 和iOS的view上的区别的更多相关文章

  1. Android 和iOS中 View的滚动

    在最近的程序中用到了Android中的View的滚动,记录一下,待总结.

  2. Android与ios 在input上的差异

    input{ -webkit-appearance:none; }

  3. MAUI与Blazor共享一套UI,媲美Flutter,实现Windows、macOS、Android、iOS、Web通用UI

    1. 前言 距离上次发<MAUI初体验:爽>一文已经过去2个月了,本计划是下半年或者明年再研究MAUI的,现在计划提前啦,因为我觉得MAUI Blazor挺有意思的:在Android.iO ...

  4. android和ios,音频互通方案

    好久不更新博客上,从年前从公司辞职,这半年以来,一直靠做一些外包app养活自己!也算是达成了自己年前制定的目标!可是也想着总不能一直做外包吧,所以决定做一些自己觉得有意思的app,挂到应用商店上和ap ...

  5. 测试中Android与IOS分别关注的点

    主要从本身系统的不同点.系统造成的不同点.和注意的测试点做总结 1.自身不同点 研发商:Adroid是google公司做的手机系统,IOS是苹果公司做的手机系统 开源程度:Android是开源的,IO ...

  6. 我所理解的Android和iOS上的View

    View,几乎是所有界面系统中的基类,在iOS里面是UIView,在Android里是View. 那么,到底View是什么东西,他做了些什么,他是怎么做到的,在这篇文章中,希望能带给大家一些启发. 抽 ...

  7. Android 和iOS 中关于View 的一点知识

    View的概念和方法十分重要,这里将对Android 和iOS中出现的,关于视图的一些知识点进行总结,预计文章会比较长,要许多时间慢慢补充. 先转载一部分资料,感谢原作者! 原链接为:http://b ...

  8. React Native常用组件在Android和IOS上的不同

    React Native常用组件在Android和IOS上的不同 一.Text组件在两个平台上的不同表现 1.1 height与fontSize 1.1.1只指定font,不指定height 在这种情 ...

  9. GitHub Android 最火开源项目Top20 GitHub 上的开源项目不胜枚举,越来越多的开源项目正在迁移到GitHub平台上。基于不要重复造轮子的原则,了解当下比较流行的Android与iOS开源项目很是必要。利用这些项目,有时能够让你达到事半功倍的效果。

    1. ActionBarSherlock(推荐) ActionBarSherlock应该算得上是GitHub上最火的Android开源项目了,它是一个独立的库,通过一个API和主题,开发者就可以很方便 ...

随机推荐

  1. ActionScript学习笔记

    ActionScript学习笔记 ActionScript中预定义的数据类型:Boolean.int.Number.String.uint 其中,int.Number.uint是处理数字的.int用来 ...

  2. Linux 高精確的時序(sleep, usleep,nanosleep) from:http://blog.sina.com.cn/s/blog_533ab41c0100htae.html

    Linux 高精確的時序(sleep, usleep,nanosleep) (2010-04-14 17:18:26) 转载▼ 标签: 杂谈 分类: linux 首先, 我会说不保证你在使用者模式 ( ...

  3. 【9-6】Centos学习笔记

    linux文件系统结构 常用技巧 快捷键启动终端 su命令,使用超级用户登陆 visudo :编辑用户权限 tar xf 文件名:解压文件 Vim编辑器 Tips yum包管理:Yum(全称为 Yel ...

  4. 大熊君大话NodeJS之------Buffer模块

    一,开篇分析 所谓缓冲区Buffer,就是 "临时存贮区" 的意思,是暂时存放输入输出数据的一段内存. JS语言自身只有字符串数据类型,没有二进制数据类型,因此NodeJS提供了一 ...

  5. Error: [ng:areq] Argument 'xxxx' is not a function, got undefined

    "Error: [ng:areq] Argument 'keywords' is not a function, got undefined" 代码类似这样的: <div n ...

  6. 使用Javascript实现返回顶部功能。

    为了提高网站的浏览体验及友好度,相信大部分网站需要一个返回顶部的按钮,如果使用传统的a标记,再做一个div加上链接的话,非常麻烦,不仅每个页面都需要添加,而且不能实现非常智能的效果及简化维护时间. 下 ...

  7. GCD与NSOperationQueue

    1> GCD是纯C语言的API,NSOperationQueue是基于GCD的OC版本封装 2> GCD只支持FIFO(先入先出)的队列,NSOperationQueue可以很方便地调整执 ...

  8. brew gradle

    cat /usr/local/Library/Taps/homebrew/homebrew-versions/gradle221.rb GRADLE_HOME=/Users/temp/gradle22 ...

  9. APPCAN IDE中安装emmet插件

    1.首先打开APPCAN IDE 2.帮助(help)-安装新软件(install New sofaWare) 3.打开Install窗口,点击 Add,在Add Repository窗口中,Name ...

  10. Java设计模式 之 工厂方法模式

    1. 使用设计模式的好处:可提高代码的重复性,让代码更容易被他人理解,保证代码的可靠性. 2. 工厂模式定义:就是创建一个工厂类来创建你需要的类,工厂模式包括工厂模式和抽象工厂模式,抽象工厂模式是工厂 ...