FDSlideBar
FDSlideBar copied to clipboard
FDSliderBar类里面scrollToVisibleItem:方法
if (selectedItemIndex < visibleItemIndex) { // The item to be visible is on the right of the selected item and the selected item is out of screeen by the left, also the opposite case, set the offset respectively if (CGRectGetMaxX(_selectedItem.frame) < offset.x) { offset.x = CGRectGetMinX(item.frame); } else { offset.x = CGRectGetMaxX(item.frame) - CGRectGetWidth(_scrollView.frame); } }
在selectedItemIndex < visibleItemIndex的条件下并不会出现CGRectGetMaxX(_selectedItem.frame) < offset.x的情况啊,直接 if (selectedItemIndex < visibleItemIndex) { // The item to be visible is on the right of the selected item and the selected item is out of screeen by the left, also the opposite case, set the offset respectively offset.x = CGRectGetMaxX(item.frame) - CGRectGetWidth(_scrollView.frame);
}else{
........
}就可以啊
会出现的。选中上面的某一个item,然后把它滑出scrollView的左边不能显示时,现在你滑动下面的content内容,便会出现这个case。
如果嵌套一个tableView在其中,怎么实现其中数据的同步,还有怎么实现选中指定的标题?
点击一个item进入其他viewCOntroller,再退出来,item就发生偏移了,难道就我一个人遇到这样的问题吗?