在tabBar区域加个视图

 1 CGRect frame = CGRectMake(0032048);
2
3 UIView *v = [[UIView alloc]initWithFrame:frame];
4
5 [v setBackgroundColor:[[UIColor allor]initWithRed:70.0/255.0
6
7 green:65.0/255.0
8
9 blue:62.0/255.0
10
11 alpha:1.0]];
12
13 [rootController.tabBar insertSubview:v atIndex:0];
14
15 [v release];

注意:

addSubview是将view添加到所有层的最顶层,相当于将insertSubView的atIndex参数设置成[view.subviews count]。这是因为子视图是以栈的方式存放的,每次添加子视图都是在最后面追加。insertSubview是添加到指定的层位置

[view addSubview:one view] 等价于[view insertSubview:oneview atIndex:[view.subviews count]];

相关文章:

  • 2021-09-13
  • 2021-10-30
  • 2022-02-05
  • 2022-12-23
  • 2022-02-07
  • 2021-11-13
  • 2021-11-17
  • 2021-06-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2021-04-25
  • 2022-12-23
  • 2021-12-04
相关资源
相似解决方案