有没有办法子类化或自定义UIActivityViewController
来创建一种自定义视图?例如,请参阅应用Overcast下面的图片。我想创建一个类似的视图,如果你点击一个按钮,视图会弹出,当你点击视图外,它会向下滑动。
答案 0 :(得分:0)
为什么不使用UIView?将它的初始帧的y值设置为-self.customView.frame.size.height,并使用[UIView animateWithDuration]
将其框架设置为正常位置
-(void)showCustomView{
[self.customview setFrame:CGRectMake(0, -self.customView.frame.size.height, self.view.bounds.size.height+self.customView.frame.size.width, self.customView.frame.size.height)];
[UIView animateWithDuration:0.25 animations:^{
[self.customView setFrame:CGRectMake(0, -self.view.frame.size.height, self.view.bounds.size.height-self.customView.frame.size.width, self.customView.frame.size.height)];
}];
}
-(void)hideCustomView{
[UIView animateWithDuration:0.25 animations:^{
[self.customView setFrame:CGRectMake(0, -self.customView.frame.size.height, self.customView.bounds.size.height+self.customView.frame.size.width, self.customView.frame.size.height)];
}];
}
添加UITapGestureRecognizer
并在hideCustomView
customView