如何获得我正在控制的视图或子视图的实际尺寸?例如:
UIView *firstView = [[UIView alloc] initWithFrame:CGRectMake(0,0,200,100)];
[self addSubview:firstView];
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(10, 20, 230, 120)];
[firstView addSubview:button];
如您所见,我的button
对象超出了它被添加到的视图的尺寸。
考虑到这一点(假设有许多对象被添加为子视图),我如何确定的实际宽度和高度firstView
?