简体   繁体   English

iOS:在特定坐标下,将一个UIView添加为另一个UIView的子视图

[英]iOS: At a specific coordinate, adding a UIView as subview of another UIView

I have ten (x,y) coordinates values in NSInteger array. 我在NSInteger数组中有十个(x,y)坐标值。 //Yet to implement //尚未实施

I want to add a series (10 array) of UIView on another bigger UIView . 我想补充的UIView的系列(10阵列)上的另一个大的UIView。

[self.myBiggerView addSubview:mySmallView];

I am not getting how to add mySmallView at a specific (my coordinate array) coordinate. 我没有得到如何在特定(我的坐标数组)坐标处添加mySmallView的信息 Please help 请帮忙

Either after or before 之后或之前

[self.myBiggerView addSubview:mySmallView];

Set the frame of your small view like this: 像这样设置小视图的框架:

mySmallView.frame = CGRectMake(coord1,coord2,width,height);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM