【发布时间】:2016-11-04 13:27:11
【问题描述】:
我正在实现一个滚动视图选择器,我已经实现了大部分部分,但我一直在改变它滚动时的大小。
我正在尝试这样做:
我已经到了这里,但我不知道如何使用滚动偏移来更改大小我尝试了很多东西但失败了我需要帮助
我正在使用SwipeView 来获取滚动条
func swipeViewDidScroll(swipeView: SwipeView!) {
//USE swipeView.currentItemView to access current view
//USE swipeView.itemViewAtIndex(swipeView.currentItemIndex - 1) to access previous view
//USE swipeView.itemViewAtIndex(swipeView.currentItemIndex + 1) to access next View
swipeView.currentItemView.frame = CGRect(x: swipeView.currentItemView.bounds.origin.x, y: swipeView.currentItemView.bounds.origin.y , width: (swipeView.currentItemView.bounds.width + swipeView.scrollOffset) - CGFloat((280 * swipeView.currentItemIndex)), height: swipeView.currentItemView.bounds.height)
}
我已附上该项目,以使您的工作更容易理解我的工作 LINK TO PROJECT
【问题讨论】:
-
你可以使用collection view来做对吗?
-
你在使用自动布局吗?
-
@O-mkar 试试这个stackoverflow.com/questions/30063979/…
标签: ios objective-c swift uiscrollview