Skip to content

Commit e4aa5ae

Browse files
李林李林
李林
authored and
李林
committed
readme
1 parent 26e4e50 commit e4aa5ae

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

0.gif

1.52 MB
Loading

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
11
# PopView
22
## 弹出自定义视图控件,使用简单,耦合度小(popView)
33

4+
### 0、类似实现DropDownMunu类型的动画
5+
~~~
6+
-(void)chooseClick:(UIButton *)btn{
7+
btn.selected = !btn.selected;
8+
if (btn.selected) {
9+
[UIView animateWithDuration:0.25 animations:^{
10+
btn.imageView.transform = CGAffineTransformRotate(btn.transform, M_PI);
11+
}];
12+
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 64, self.view.bounds.size.width, 0)];
13+
[self.view addSubview:view];
14+
PopView *popView = [PopView popSideContentView:self.chooseListView belowView:view];
15+
popView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.2];
16+
[popView setDidRemovedFromeSuperView:^{
17+
btn.selected = NO;
18+
[UIView animateWithDuration:0.25 animations:^{
19+
btn.imageView.transform = CGAffineTransformIdentity;
20+
}];
21+
}];
22+
[view removeFromSuperview];
23+
}else{
24+
[UIView animateWithDuration:0.25 animations:^{
25+
btn.imageView.transform = CGAffineTransformIdentity;
26+
}];
27+
[PopView hidenPopView];
28+
}
29+
}
30+
~~~
31+
32+
![img](https://github.com/xiaohu036/PopView/blob/master/0.gif)
33+
434
### 1、类似QQ和微信消息页面的右上角微型菜单弹窗
535
~~~
636
PopView *popView = [PopView showPopViewDirect:PopViewDirection_Bottom onView:sender contentView:self.popContentView];

0 commit comments

Comments
 (0)