(iOS)什么是superview,什么是子视图 [英] ( iOS ) What is superview and what is subviews

查看:376
本文介绍了(iOS)什么是superview,什么是子视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是superview?什么是子视图?

What is superview and what is subviews?

当我添加此代码时:

[self.view addSubview:self.frontView];
// what does that mean ?

并且......

@property (nonatomic, strong) IBOutlet UIImageView *frontView;
[self.frontView superview] != nil // means ?

superview中的内容是什么?

what is in superview?

推荐答案

superview 表示一个视图,其中包含另一个视图。 子视图表示通过查看保留/添加的视图。

superview means a view which holds the another view over it. subviews means the views which are holding/added over a 'View'.

让我们说。你有一个视图 MyView ,它上面有一个UIButton(loginButton)。所以, MyView superview ,用于 loginButton loginButton是 MyView`的子视图。

Lets Say. you have a view MyView which has a UIButton(loginButton) over it.So, MyView is superview for that loginButton. loginButton is a subview forMyView`.

更多信息,请从这里开始

这篇关于(iOS)什么是superview,什么是子视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆