//通过xib创建
    NSBundle    * bundle = [NSBundle mainBundle];
    NSArray     * arr = [bundle loadNibNamed:@"myView" owner:self options:nil];
    UIView      * myView = [arr objectAtIndex:0];
    
    //通过代码创建
    CGRect      viewRect = CGRectMake(0, 0, 100, 100);
    UIView      * myView = [[UIView alloc] initWithFrame:viewRect];

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-27
  • 2021-05-03
  • 2021-10-19
  • 2022-12-23
  • 2022-01-09
  • 2021-07-07
相关资源
相似解决方案