All Projects → gltwy → LTAutoScrollView

gltwy / LTAutoScrollView

Licence: MIT license
自定义CollectionView轮播图,不依赖任何图片加载框架,可实现自定义pageControl,自定义轮播View,自定义滚动样式等等

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to LTAutoScrollView

Widgetlayout
自定义ViewGroup的集合(有 kotlin 实现分支):提高编写效率和 UI 绘制性能,少嵌套,易用易扩展。
Stars: ✭ 130 (+128.07%)
Mutual labels:  scrollview
Mxscroll
Easier with scroll
Stars: ✭ 159 (+178.95%)
Mutual labels:  scrollview
Overscroll Decor
Android: iOS-like over-scrolling effect applicable over almost all scrollable Android views.
Stars: ✭ 2,671 (+4585.96%)
Mutual labels:  scrollview
React Native Directed Scrollview
UNMAINTAINED- see below. A natively implemented scrollview component which lets you specify different scroll directions for child content.
Stars: ✭ 139 (+143.86%)
Mutual labels:  scrollview
Observablescrollview
高仿美团APP页面滑动标题栏渐变效果
Stars: ✭ 153 (+168.42%)
Mutual labels:  scrollview
Jxpagingview
类似微博主页、简书主页等效果。多页面嵌套,既可以上下滑动,也可以左右滑动切换页面。支持HeaderView悬浮、支持下拉刷新、上拉加载更多。
Stars: ✭ 2,309 (+3950.88%)
Mutual labels:  scrollview
Hycycleview
多页面分页、循环、嵌套滑动悬停
Stars: ✭ 123 (+115.79%)
Mutual labels:  scrollview
DraggableModalTransition
Enables dragging interaction and animation of scrollView in a similar way to Facebook Messenger app.
Stars: ✭ 63 (+10.53%)
Mutual labels:  scrollview
Unitydynamicscrollrect
An optimized approach to lists with dozens of elements and a Pooling system
Stars: ✭ 157 (+175.44%)
Mutual labels:  scrollview
Aquaman
A pure-Swift library for nested display of horizontal and vertical scrolling views
Stars: ✭ 228 (+300%)
Mutual labels:  scrollview
Lazyscrollview
An iOS ScrollView to resolve the problem of reusability in views.
Stars: ✭ 1,766 (+2998.25%)
Mutual labels:  scrollview
Tangram Ios
Tangram is a modular UI solution for building native page dynamically, including Tangram for Android, Tangram for iOS and even backend CMS. This project provides the sdk on iOS platform.
Stars: ✭ 1,800 (+3057.89%)
Mutual labels:  scrollview
Kohii
Android Video Playback made easy.
Stars: ✭ 204 (+257.89%)
Mutual labels:  scrollview
React Native Modalize
A highly customizable modal/bottom sheet that loves scrolling content.
Stars: ✭ 2,119 (+3617.54%)
Mutual labels:  scrollview
UnityDynamicScrollView
Dynamic scrollView based on UGUI
Stars: ✭ 161 (+182.46%)
Mutual labels:  scrollview
Jxsegmentedview
A powerful and easy to use segmented view (segmentedcontrol, pagingview, pagerview, pagecontrol, categoryview) (腾讯新闻、今日头条、QQ音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流APP分类切换滚动视图)
Stars: ✭ 1,905 (+3242.11%)
Mutual labels:  scrollview
Xlimageviewer
iOS 仿照今日头条的图片浏览工具。
Stars: ✭ 161 (+182.46%)
Mutual labels:  scrollview
any-scroll
🚀 模拟scrollview, 支持pc/移动端, 让实现Tab/Slider等组件轻而易举.
Stars: ✭ 45 (-21.05%)
Mutual labels:  scrollview
react-native-scrollable-animated-header
🤯 React Native Animated Header with ScrollView
Stars: ✭ 112 (+96.49%)
Mutual labels:  scrollview
React Native Swiper Flatlist
👆 Swiper component implemented with FlatList using Hooks & Typescript + strict automation tests with Detox
Stars: ✭ 217 (+280.7%)
Mutual labels:  scrollview

LTAutoScrollView

CI Status Version License Platform

image

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation with CocoaPods

CocoaPods is a dependency manager for Swift, which automates and simplifies the process of using 3rd-party libraries like LTAutoScrollView in your projects. You can install it with the following command:

$ gem install cocoapods

Podfile

To integrate LTAutoScrollView into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

target 'TargetName' do
pod 'LTAutoScrollView'
end

Then, run the following command:

$ pod install

Usage

创建LTAutoScrollView

let autoScrollView = LTAutoScrollView(frame: CGRect(x: 0, y: 0, width: view.bounds.width, height: 150))

//设置滚动时间间隔 默认2.0s
autoScrollView.glt_timeInterval = 1.5
        
//设置轮播图的方向 默认水平
autoScrollView.scrollDirection = .vertical

//加载网络图片传入图片url数组, 加载本地图片传入图片名称数组
autoScrollView.images = images

//加载图片,内部不依赖任何图片加载框架
autoScrollView.imageHandle = {(imageView, imageName) in
    //加载本地图片(根据传入的images数组来决定加载方式)
    imageView.image = UIImage(named: imageName)
    //加载网络图片(根据传入的images数组来决定加载方式)
    //imageView.kf.setImage(with: URL(string: imageName))
}

// 滚动手势禁用(文字轮播较实用) 默认为false
autoScrollView.isDisableScrollGesture = false

//设置pageControl View的高度 默认为20
autoScrollView.gltPageControlHeight = 20;

// 是否自动轮播 默认true
autoScrollView.isAutoScroll = true

//dot在轮播图的位置 中心 左侧 右侧 默认居中
autoScrollView.dotDirection = .default

//点击事件
autoScrollView.didSelectItemHandle = {
    print("autoScrollView1 点击了第 \($0) 个索引")
}

//自动滚动到当前索引事件
autoScrollView.autoDidSelectItemHandle = { index in
    print("autoScrollView1 自动滚动到了第 \(index) 个索引")
}

//PageControl点击事件
autoScrollView.pageControlDidSelectIndexHandle = { index in
    print("autoScrollView1 pageControl点击了第 \(index) 个索引")
}

//设置pageControl的位置
autoScrollView.dotDirection = .right
//dot在轮播图的位置 左侧 或 右侧时,距离最屏幕最左边或最最右边的距离,默认0
autoScrollView.adjustValue = 15.0
//pageControl高度调整从而改变pageControl位置 默认20
autoScrollView.gltPageControlHeight = 25

//设置LTDotLayout,更多dot使用见LTDotLayout属性说明
let layout = LTDotLayout(dotImage: dotImage, dotSelectImage: dotSelectImage)
layout.dotMargin = 10.0
autoScrollView.dotLayout = layout

LTDotLayout属性说明

/* dot单独的一个的宽度 */
public var dotWidth: CGFloat = isPostDotSize
/* dot单独的一个的高度 */
public var dotHeight: CGFloat = isPostDotSize
/* dot之间的间距 */
public var dotMargin: CGFloat = 15.0
/* dot未选中的图片 */
public var dotImage: UIImage?
/* dot选中后的图片 */
public var dotSelectImage: UIImage?
/* dot未选中的颜色 */
public var dotColor: UIColor = UIColor.clear
/* dot选中的后颜色 */
public var dotSelectColor: UIColor = UIColor.clear
/* custom为默认是自定义 , 想使用类似系统样式传入default */
public var dotType: LTAutoScrollViewType = .custom
/* 滚动过程是否放大当前dot */
public var isScale: Bool = true
/* 滚动过程dot放大倍率 */
public var scaleXY: CGFloat = 1.4

Author

[email protected]

License

LTAutoScrollView is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].