通常我们会遇到各种各样的页面切换需求,这时需要一个类似下方的下标随着页面的切换而换位置,我之前的做法都是分别计算出该下面的frame。然后移动。今天发现了一个更好的不用计算坐标的写法,在这里记录下

[UIView animateWithDuration:0.2 animations:^{
CGPoint center =_line.center;
center.x= tap.view.center.x;
_line.center= center;
}];
//tap 为传过来的手势。btn一样使用
网友评论