子视图在其超级视图之外显示
问题描述:
在我的iPad应用程序中,我有一个名为“myView”的UIView
对象,其框架为(0,0,600,500)。现在,我想在这个MyView的加UIImageView
,所以这里是我做这个代码:子视图在其超级视图之外显示
UIImageView *myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(-100, 0,100, 200)];
[myImageView setImage:UIImage imageNamed:@"myImage.png"];
[myView addSubView:myImageView];
[myImageView release];
所以,根据这个代码myImageView不应显示其x坐标为“-100”和宽度“100”。但它显示在左侧的myView中。
任何人都可以请帮忙解决这个问题吗?
它可能会帮助你:[点击此链接](http://stackoverflow.com/questions/13016354/subview-displaying-outside-the-bounds-of-the-parent-uiview) – FARAZ 2016-03-03 06:02:09