//显示
- (void) show:(UIView*)parent
{
parentView = parent;
//先隐藏backView,table
backView.alpha = 0;
_table.alpha = 0;
//移动table
[_table setTransform:CGAffineTransformMakeTranslation(0, _table.frame.size.height)];
//父窗口添加本view,---这个会调用viewDidLoad
[parentView.superview addSubview:self.view];
//添加动画,添加到父窗口中,使之从下移动上
[UIView animateWithDuration:0.3 animations:^{
//父窗口缩小
CGAffineTransform t = CGAffineTransformMakeScale(0.9, 0.9);
[parentView setTransform:t];
//显示backview,table
backView.alpha = 1;
_table.alpha = 1;
//移动table,CGAffineTransformIdentity还原原始坐标
[_table setTransform:CGAffineTransformIdentity];
} completion:^(BOOL finished) {
}];
}
//隐藏
- (void) hide
{
//添加动画,添加到父窗口中,使之从下移动上
[UIView animateWithDuration:0.3 animations:^{
//父窗口还原
CGAffineTransform t = CGAffineTransformIdentity;
[parentView setTransform:t];
//显示backview,table
backView.alpha = 0;
_table.alpha = 0;
//移动table
[_table setTransform:CGAffineTransformMakeTranslation(0, _table.frame.size.height)];
} completion:^(BOOL finished) {
[self.view removeFromSuperview];
}];
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor clearColor];
//背影黑罩
backView = [[UIView alloc]initWithFrame:self.view.bounds];
backView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.3];
[self.view addSubview:backView];
//算出table的CGRect
CGRect rect = self.view.bounds;
int height = _titleArray.count * 44;
rect.origin.y = rect.size.height - height;
rect.size.height = height;
_table = [[UITableView alloc]initWithFrame:rect];
_table.delegate = self;
_table.dataSource = self;
[self.view addSubview:_table];
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有