LTScrollViewiOS ScrollView 嵌套解決方案
ScrollView 嵌套 ScrolloView(UITableView 、UICollectionView)解決方案, 支持OC / Swift。
Demo文件路徑以及說明
- LTScrollView / Example : 為 Swift 使用示例.
- LTScrollView / OCExample : 為 OC 使用示例.
- 支持的子 View 為 UIScrollView、UICollectionView、UITableView.
CocoaPods安裝
安裝CocoaPods 使用以下命令:
$ gem install cocoapods
Podfile
在你的 Podfile中添加LTScrollView
source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' target 'TargetName' do #注意此處需要添加use_frameworks! use_frameworks! pod 'LTScrollView', '~> 0.2.0' end
然后,使用以下命令安裝
$ pod install
提示錯誤 [!] Unable to find a specification for LTScrollView 解決辦法:
$ pod repo remove master
$ pod setup
Swift使用說明
Swift.LTSimple使用說明
- 創(chuàng)建LTSimpleManager實(shí)例對象
@objc public init(frame: CGRect, viewControllers: [UIViewController], titles: [String], currentViewController:UIViewController, layout: LTLayout)
- 設(shè)置headerView
@objc public func configHeaderView(_ handle: (() -> UIView?)?)
- 子控制器中g(shù)lt_scrollView進(jìn)行賦值
self.glt_scrollView = self.tableView(self.scrollView / self.collectionView)
- 更多使用說明請參考Demo(LTScrollView / Example)
Swift.LTAdvanced使用說明
- 創(chuàng)建LTAdvancedManager實(shí)例對象、并設(shè)置headerView
@objc public init(frame: CGRect, viewControllers: [UIViewController], titles: [String], currentViewController:UIViewController, layout: LTLayout, headerViewHandle handle: () -> UIView)
- 子控制器中g(shù)lt_scrollView進(jìn)行賦值
self.glt_scrollView = self.tableView(self.scrollView / self.collectionView)
- 更多使用說明請參考Demo(LTScrollView / Example)
OC使用說明
OC.LTSimple使用說明
- 創(chuàng)建LTSimpleManager實(shí)例對象
[[LTSimpleManager alloc] initWithFrame:frame viewControllers:self.viewControllers titles:self.titles currentViewController:self layout:self.layout]
- 設(shè)置headerView
[self.managerView configHeaderView:^UIView * _Nullable{ }]
- 子控制器中g(shù)lt_scrollView進(jìn)行賦值
self.glt_scrollView = self.tableView(self.scrollView / self.collectionView)
- 更多使用說明請參考Demo(LTScrollView / OCExample)
OC.LTAdvanced使用說明
- 創(chuàng)建LTAdvancedManager實(shí)例對象、并設(shè)置headerView
[[LTAdvancedManager alloc] initWithFrame:frame viewControllers:self.viewControllers titles:self.titles currentViewController:self layout:self.layout headerViewHandle:^UIView * _Nonnull{}]
- 子控制器中g(shù)lt_scrollView進(jìn)行賦值
self.glt_scrollView = self.tableView(self.scrollView / self.collectionView)
- 更多使用說明請參考Demo(LTScrollView / OCExample)
LTLayout屬性說明
詳情查看LTLayout.swift
評論
圖片
表情
