UIView层次管理(sendSubviewToBack,bringSubviewToFront)
来源:互联网 发布:推荐mac游戏 编辑:程序博客网 时间:2024/05/19 22:55
转载自:http://liwpk.blog.163.com/blog/static/363261702011613112149802/
- (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层次管理
- NESSUS 5.0 离线安装
- 2、HTTP协议
- Selenium 入门视频
- 用bat运行jar
- ProgressBar定时更新、取消
- UIView层次管理(sendSubviewToBack,bringSubviewToFront)
- IIC China 2013展会后记
- pl/sql developer常用设置
- 设置默认VS2005的调试浏览器
- 浅谈J2EE十三个规范
- 简单使用线程池
- C#/C++ interop: A simple example
- vba 浏览文件夹对话框
- ATMEL AT91SAM9X25官方推荐Uboot编译方法