【发布时间】:2014-08-10 23:56:45
【问题描述】:
这可能是一个非常愚蠢的问题,但我已经以编程方式创建了一个 UIView,但我似乎无法在代码中的任何地方访问它,除了它所在的实际方法(例如从superview 或修改视图)。
这是我用来创建 UIView 的代码:
CGRect frame;
frame.size = CGSizeMake((gameView.bounds.size.width-50), 400);
frame.origin.x = 25;
frame.origin.y = 130;
UIView *endGameView = [[UIView alloc] initWithFrame:frame];
endGameView.backgroundColor = [UIColor colorWithRed:235.0f/255.0f
green:235.0f/255.0f
blue:235.0f/255.0f
alpha:1.0f];
[gameView addSubview:endGameView];
【问题讨论】:
标签: objective-c xcode uiview