ios开发怎么获取uiview自动变化后的宽度

2025-05-07 04:56:24
推荐回答(1个)
回答1:

UIView *v1 = [[UIView alloc] init];
  [self.view addSubview:v1];
  UIView *v2 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
  v2.backgroundColor = [UIColor redColor];
  [v1 addSubview:v2];