UIView层次管理(sendSubviewToBack,bringSubviewToFront)
来源:互联网 发布:淘宝联盟教程 编辑:程序博客网 时间:2024/05/21 15:42
- (void)viewDidLoad {
[super viewDidLoad];
UILabel *labelA = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 100, 43)];
labelA.lineBreakMode = UILineBreakModeWordWrap;
labelA.numberOfLines = 0;
[labelA setTextAlignment:UITextAlignmentCenter];
[labelA setBackgroundColor:[UIColor clearColor]];
labelA.text = @"ABCDEFGHIJ";
... ...
UISegmentedControl *mySegment = [[UISegmentedControl alloc]initWithItems:[NSArray arrayWithObjects:@" ",@" ",@" ",nil]];
[mySegment setFrame:CGRectMake(10, 0, 300, 43)];
[mySegment setSelectedSegmentIndex:0];
[self.view addSubview:mySegment];
[self.view addSubview:labelA];
[self.view sendSubviewToBack:mySegment];
... ...
[mySegment release];
[labelA release];
... ...
}
附:
将一个UIView显示在最前面只需要调用其父视图的 bringSubviewToFront()方法。
将一个UIView层推送到背后只需要调用其父视图的 sendSubviewToBack()方法。
- UIView层次管理(sendSubviewToBack,bringSubviewToFront)
- UIView层次管理(sendSubviewToBack,bringSubviewToFront)
- UIView层次管理(sendSubviewToBack,bringSubviewToFront)
- UIView层次管理(sendSubviewToBack,bringSubviewToFront)
- UIView层次管理(sendSubviewToBack,bringSubviewToFront)
- UIView层次管理(sendSubviewToBack,bringSubviewToFront)
- UIView层次管理(sendSubviewToBack,bringSubviewToFront)
- UIView层次管理(sendSubviewToBack,bringSubviewToFront)
- UIView层次切换(bringSubviewToFront,sendSubviewToBack)的使用
- iOS 视图层次管理 sendSubviewToBack、bringSubviewToFront
- iOS 视图层次管理 sendSubviewToBack、bringSubviewToFront
- ios工作札记2——UIView层次管理(sendSubviewToBack,bringSubviewToFront)
- sendSubviewToBack,bringSubviewToFront
- BringSubviewToFront sendSubviewToBack 小结
- bringSubviewToFront/sendSubviewToBack/removeFromSuperview
- sendSubviewToBack和bringSubviewToFront
- bringSubviewToFront()和sendSubviewToBack()
- UIView层次管理
- 简单分析Android中添加shortcut方面的源码 .
- 你必须知道的.NET之对接口和抽象类
- 让每天变为26 小时
- USACO section Camelot(枚举+队列优化)
- webservice的优点和缺点
- UIView层次管理(sendSubviewToBack,bringSubviewToFront)
- <iOS, Android>移动原型工具总结
- Oracle 11g RAC CRS-4535/ORA-15077
- XMLHTTPRequest对象
- 堆corruption调试
- 认识CDMS
- Mapping '/var/mobile/Library/Caches/com.apple.keyboards/images/tmp.gcyBAl37' failed: 'Invalid argume
- POSIX线程操作,转的有点乱,将就记录一下
- C++reference~~~