【发布时间】:2011-08-23 21:59:45
【问题描述】:
我的 UIViews 有问题,我有一个框架为 240*320 的白色 UIView,以及一个框架为 480*20 的黑色 UIView,我将白色视图添加到我的 480*320 横向主视图中,然后我将黑色视图添加到白色视图中,黑色视图不仅在白色视图之上,而且在mainView之上,我不想在mainView之上,有人知道解决方案吗?,这是代码:
UIView *aView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 240, 320)];
UIView *otherView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 480, 20)];
[aView setBackgroundColor:[UIColor whiteColor]];
[otherView setBackgroundColor:[UIColor blackColor]];
[aView addSubview:otherView];
[[self view] addSubview:aView];
【问题讨论】:
标签: objective-c cocoa-touch xcode ios uiview