首先獻上本控件的項目地址
Untitled.gif
使用方法
1.導入
#import "LXSegmentScrollView.h"
2.初始化方法
LXSegmentScrollView *scView=[[LXSegmentScrollView alloc] initWithFrame:CGRectMake(0, 64, self.view.bounds.size.width, self.view.bounds.size.height-64) titleArray:@[@"頭條",@"搞笑",@"視頻"] contentViewArray:array];
[self.view addSubview:scView];
注:因時間原因部分功能還沒開發完,如有需求請自行添加,敬請原諒。
如有任何問題歡迎大家交流指正。
已修復的bug:添加UINavigationController后無法顯示問題,原因請看UIScrollView自動向下偏移的問題
在controller中添加
self.automaticallyAdjustsScrollViewInsets=NO;
更新:增加滑動時色塊的動畫