├── .gitignore ├── LICENSE ├── README.md ├── STScrollBarDemo ├── STScrollBarDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── STScrollBarDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── STScrollBar │ ├── STScrollBar.h │ ├── STScrollBar.m │ ├── UIView+ST.h │ └── UIView+ST.m │ ├── ViewController.h │ ├── ViewController.m │ ├── main.m │ └── picture0.png ├── gif0.gif └── picture0.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 沈天 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # STScrollBar 2 | 一个文本的滚动条,低耦合,高内聚,更多的接口使用。感觉不错给个星星,如果有问题,请issue我,谢谢。 3 | ##效果图 4 | ![image](https://github.com/STShenZhaoliang/STScrollBar/blob/master/gif0.gif) 5 | 6 | ##接口 7 | ![image](https://github.com/STShenZhaoliang/STScrollBar/blob/master/picture0.png) 8 | 9 | ####问题 10 | 如果有问题,请issue我或是QQ@我。 11 | 12 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 67907C201CD06C53001E74F1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 67907C1F1CD06C53001E74F1 /* main.m */; }; 11 | 67907C231CD06C53001E74F1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 67907C221CD06C53001E74F1 /* AppDelegate.m */; }; 12 | 67907C261CD06C53001E74F1 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 67907C251CD06C53001E74F1 /* ViewController.m */; }; 13 | 67907C291CD06C53001E74F1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 67907C271CD06C53001E74F1 /* Main.storyboard */; }; 14 | 67907C2B1CD06C53001E74F1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 67907C2A1CD06C53001E74F1 /* Assets.xcassets */; }; 15 | 67907C2E1CD06C53001E74F1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 67907C2C1CD06C53001E74F1 /* LaunchScreen.storyboard */; }; 16 | 67907C381CD06C90001E74F1 /* UIView+ST.m in Sources */ = {isa = PBXBuildFile; fileRef = 67907C371CD06C90001E74F1 /* UIView+ST.m */; }; 17 | 67907C3B1CD06CD9001E74F1 /* STScrollBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 67907C3A1CD06CD9001E74F1 /* STScrollBar.m */; }; 18 | 67907C3D1CD07DF4001E74F1 /* picture0.png in Resources */ = {isa = PBXBuildFile; fileRef = 67907C3C1CD07DF4001E74F1 /* picture0.png */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 67907C1B1CD06C53001E74F1 /* STScrollBarDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = STScrollBarDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 67907C1F1CD06C53001E74F1 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 24 | 67907C211CD06C53001E74F1 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 25 | 67907C221CD06C53001E74F1 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 26 | 67907C241CD06C53001E74F1 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 27 | 67907C251CD06C53001E74F1 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 28 | 67907C281CD06C53001E74F1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 29 | 67907C2A1CD06C53001E74F1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 30 | 67907C2D1CD06C53001E74F1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 31 | 67907C2F1CD06C53001E74F1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 67907C361CD06C90001E74F1 /* UIView+ST.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+ST.h"; sourceTree = ""; }; 33 | 67907C371CD06C90001E74F1 /* UIView+ST.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+ST.m"; sourceTree = ""; }; 34 | 67907C391CD06CD9001E74F1 /* STScrollBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STScrollBar.h; sourceTree = ""; }; 35 | 67907C3A1CD06CD9001E74F1 /* STScrollBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STScrollBar.m; sourceTree = ""; }; 36 | 67907C3C1CD07DF4001E74F1 /* picture0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = picture0.png; sourceTree = ""; }; 37 | /* End PBXFileReference section */ 38 | 39 | /* Begin PBXFrameworksBuildPhase section */ 40 | 67907C181CD06C53001E74F1 /* Frameworks */ = { 41 | isa = PBXFrameworksBuildPhase; 42 | buildActionMask = 2147483647; 43 | files = ( 44 | ); 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | /* End PBXFrameworksBuildPhase section */ 48 | 49 | /* Begin PBXGroup section */ 50 | 67907C121CD06C53001E74F1 = { 51 | isa = PBXGroup; 52 | children = ( 53 | 67907C1D1CD06C53001E74F1 /* STScrollBarDemo */, 54 | 67907C1C1CD06C53001E74F1 /* Products */, 55 | ); 56 | sourceTree = ""; 57 | }; 58 | 67907C1C1CD06C53001E74F1 /* Products */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 67907C1B1CD06C53001E74F1 /* STScrollBarDemo.app */, 62 | ); 63 | name = Products; 64 | sourceTree = ""; 65 | }; 66 | 67907C1D1CD06C53001E74F1 /* STScrollBarDemo */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 67907C351CD06C5F001E74F1 /* STScrollBar */, 70 | 67907C211CD06C53001E74F1 /* AppDelegate.h */, 71 | 67907C221CD06C53001E74F1 /* AppDelegate.m */, 72 | 67907C241CD06C53001E74F1 /* ViewController.h */, 73 | 67907C251CD06C53001E74F1 /* ViewController.m */, 74 | 67907C271CD06C53001E74F1 /* Main.storyboard */, 75 | 67907C3C1CD07DF4001E74F1 /* picture0.png */, 76 | 67907C2A1CD06C53001E74F1 /* Assets.xcassets */, 77 | 67907C2C1CD06C53001E74F1 /* LaunchScreen.storyboard */, 78 | 67907C2F1CD06C53001E74F1 /* Info.plist */, 79 | 67907C1E1CD06C53001E74F1 /* Supporting Files */, 80 | ); 81 | path = STScrollBarDemo; 82 | sourceTree = ""; 83 | }; 84 | 67907C1E1CD06C53001E74F1 /* Supporting Files */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 67907C1F1CD06C53001E74F1 /* main.m */, 88 | ); 89 | name = "Supporting Files"; 90 | sourceTree = ""; 91 | }; 92 | 67907C351CD06C5F001E74F1 /* STScrollBar */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 67907C361CD06C90001E74F1 /* UIView+ST.h */, 96 | 67907C371CD06C90001E74F1 /* UIView+ST.m */, 97 | 67907C391CD06CD9001E74F1 /* STScrollBar.h */, 98 | 67907C3A1CD06CD9001E74F1 /* STScrollBar.m */, 99 | ); 100 | path = STScrollBar; 101 | sourceTree = ""; 102 | }; 103 | /* End PBXGroup section */ 104 | 105 | /* Begin PBXNativeTarget section */ 106 | 67907C1A1CD06C53001E74F1 /* STScrollBarDemo */ = { 107 | isa = PBXNativeTarget; 108 | buildConfigurationList = 67907C321CD06C53001E74F1 /* Build configuration list for PBXNativeTarget "STScrollBarDemo" */; 109 | buildPhases = ( 110 | 67907C171CD06C53001E74F1 /* Sources */, 111 | 67907C181CD06C53001E74F1 /* Frameworks */, 112 | 67907C191CD06C53001E74F1 /* Resources */, 113 | ); 114 | buildRules = ( 115 | ); 116 | dependencies = ( 117 | ); 118 | name = STScrollBarDemo; 119 | productName = STScrollBarDemo; 120 | productReference = 67907C1B1CD06C53001E74F1 /* STScrollBarDemo.app */; 121 | productType = "com.apple.product-type.application"; 122 | }; 123 | /* End PBXNativeTarget section */ 124 | 125 | /* Begin PBXProject section */ 126 | 67907C131CD06C53001E74F1 /* Project object */ = { 127 | isa = PBXProject; 128 | attributes = { 129 | LastUpgradeCheck = 0730; 130 | ORGANIZATIONNAME = "沈兆良"; 131 | TargetAttributes = { 132 | 67907C1A1CD06C53001E74F1 = { 133 | CreatedOnToolsVersion = 7.3; 134 | DevelopmentTeam = Z25J3BA353; 135 | }; 136 | }; 137 | }; 138 | buildConfigurationList = 67907C161CD06C53001E74F1 /* Build configuration list for PBXProject "STScrollBarDemo" */; 139 | compatibilityVersion = "Xcode 3.2"; 140 | developmentRegion = English; 141 | hasScannedForEncodings = 0; 142 | knownRegions = ( 143 | en, 144 | Base, 145 | ); 146 | mainGroup = 67907C121CD06C53001E74F1; 147 | productRefGroup = 67907C1C1CD06C53001E74F1 /* Products */; 148 | projectDirPath = ""; 149 | projectRoot = ""; 150 | targets = ( 151 | 67907C1A1CD06C53001E74F1 /* STScrollBarDemo */, 152 | ); 153 | }; 154 | /* End PBXProject section */ 155 | 156 | /* Begin PBXResourcesBuildPhase section */ 157 | 67907C191CD06C53001E74F1 /* Resources */ = { 158 | isa = PBXResourcesBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | 67907C2E1CD06C53001E74F1 /* LaunchScreen.storyboard in Resources */, 162 | 67907C2B1CD06C53001E74F1 /* Assets.xcassets in Resources */, 163 | 67907C291CD06C53001E74F1 /* Main.storyboard in Resources */, 164 | 67907C3D1CD07DF4001E74F1 /* picture0.png in Resources */, 165 | ); 166 | runOnlyForDeploymentPostprocessing = 0; 167 | }; 168 | /* End PBXResourcesBuildPhase section */ 169 | 170 | /* Begin PBXSourcesBuildPhase section */ 171 | 67907C171CD06C53001E74F1 /* Sources */ = { 172 | isa = PBXSourcesBuildPhase; 173 | buildActionMask = 2147483647; 174 | files = ( 175 | 67907C261CD06C53001E74F1 /* ViewController.m in Sources */, 176 | 67907C381CD06C90001E74F1 /* UIView+ST.m in Sources */, 177 | 67907C3B1CD06CD9001E74F1 /* STScrollBar.m in Sources */, 178 | 67907C231CD06C53001E74F1 /* AppDelegate.m in Sources */, 179 | 67907C201CD06C53001E74F1 /* main.m in Sources */, 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | }; 183 | /* End PBXSourcesBuildPhase section */ 184 | 185 | /* Begin PBXVariantGroup section */ 186 | 67907C271CD06C53001E74F1 /* Main.storyboard */ = { 187 | isa = PBXVariantGroup; 188 | children = ( 189 | 67907C281CD06C53001E74F1 /* Base */, 190 | ); 191 | name = Main.storyboard; 192 | sourceTree = ""; 193 | }; 194 | 67907C2C1CD06C53001E74F1 /* LaunchScreen.storyboard */ = { 195 | isa = PBXVariantGroup; 196 | children = ( 197 | 67907C2D1CD06C53001E74F1 /* Base */, 198 | ); 199 | name = LaunchScreen.storyboard; 200 | sourceTree = ""; 201 | }; 202 | /* End PBXVariantGroup section */ 203 | 204 | /* Begin XCBuildConfiguration section */ 205 | 67907C301CD06C53001E74F1 /* Debug */ = { 206 | isa = XCBuildConfiguration; 207 | buildSettings = { 208 | ALWAYS_SEARCH_USER_PATHS = NO; 209 | CLANG_ANALYZER_NONNULL = YES; 210 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 211 | CLANG_CXX_LIBRARY = "libc++"; 212 | CLANG_ENABLE_MODULES = YES; 213 | CLANG_ENABLE_OBJC_ARC = YES; 214 | CLANG_WARN_BOOL_CONVERSION = YES; 215 | CLANG_WARN_CONSTANT_CONVERSION = YES; 216 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 217 | CLANG_WARN_EMPTY_BODY = YES; 218 | CLANG_WARN_ENUM_CONVERSION = YES; 219 | CLANG_WARN_INT_CONVERSION = YES; 220 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 221 | CLANG_WARN_UNREACHABLE_CODE = YES; 222 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 223 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 224 | COPY_PHASE_STRIP = NO; 225 | DEBUG_INFORMATION_FORMAT = dwarf; 226 | ENABLE_STRICT_OBJC_MSGSEND = YES; 227 | ENABLE_TESTABILITY = YES; 228 | GCC_C_LANGUAGE_STANDARD = gnu99; 229 | GCC_DYNAMIC_NO_PIC = NO; 230 | GCC_NO_COMMON_BLOCKS = YES; 231 | GCC_OPTIMIZATION_LEVEL = 0; 232 | GCC_PREPROCESSOR_DEFINITIONS = ( 233 | "DEBUG=1", 234 | "$(inherited)", 235 | ); 236 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 237 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 238 | GCC_WARN_UNDECLARED_SELECTOR = YES; 239 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 240 | GCC_WARN_UNUSED_FUNCTION = YES; 241 | GCC_WARN_UNUSED_VARIABLE = YES; 242 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 243 | MTL_ENABLE_DEBUG_INFO = YES; 244 | ONLY_ACTIVE_ARCH = YES; 245 | SDKROOT = iphoneos; 246 | TARGETED_DEVICE_FAMILY = "1,2"; 247 | }; 248 | name = Debug; 249 | }; 250 | 67907C311CD06C53001E74F1 /* Release */ = { 251 | isa = XCBuildConfiguration; 252 | buildSettings = { 253 | ALWAYS_SEARCH_USER_PATHS = NO; 254 | CLANG_ANALYZER_NONNULL = YES; 255 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 256 | CLANG_CXX_LIBRARY = "libc++"; 257 | CLANG_ENABLE_MODULES = YES; 258 | CLANG_ENABLE_OBJC_ARC = YES; 259 | CLANG_WARN_BOOL_CONVERSION = YES; 260 | CLANG_WARN_CONSTANT_CONVERSION = YES; 261 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 262 | CLANG_WARN_EMPTY_BODY = YES; 263 | CLANG_WARN_ENUM_CONVERSION = YES; 264 | CLANG_WARN_INT_CONVERSION = YES; 265 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 266 | CLANG_WARN_UNREACHABLE_CODE = YES; 267 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 268 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 269 | COPY_PHASE_STRIP = NO; 270 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 271 | ENABLE_NS_ASSERTIONS = NO; 272 | ENABLE_STRICT_OBJC_MSGSEND = YES; 273 | GCC_C_LANGUAGE_STANDARD = gnu99; 274 | GCC_NO_COMMON_BLOCKS = YES; 275 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 276 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 277 | GCC_WARN_UNDECLARED_SELECTOR = YES; 278 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 279 | GCC_WARN_UNUSED_FUNCTION = YES; 280 | GCC_WARN_UNUSED_VARIABLE = YES; 281 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 282 | MTL_ENABLE_DEBUG_INFO = NO; 283 | SDKROOT = iphoneos; 284 | TARGETED_DEVICE_FAMILY = "1,2"; 285 | VALIDATE_PRODUCT = YES; 286 | }; 287 | name = Release; 288 | }; 289 | 67907C331CD06C53001E74F1 /* Debug */ = { 290 | isa = XCBuildConfiguration; 291 | buildSettings = { 292 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 293 | INFOPLIST_FILE = STScrollBarDemo/Info.plist; 294 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 295 | PRODUCT_BUNDLE_IDENTIFIER = ST.STScrollBarDemo; 296 | PRODUCT_NAME = "$(TARGET_NAME)"; 297 | }; 298 | name = Debug; 299 | }; 300 | 67907C341CD06C53001E74F1 /* Release */ = { 301 | isa = XCBuildConfiguration; 302 | buildSettings = { 303 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 304 | INFOPLIST_FILE = STScrollBarDemo/Info.plist; 305 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 306 | PRODUCT_BUNDLE_IDENTIFIER = ST.STScrollBarDemo; 307 | PRODUCT_NAME = "$(TARGET_NAME)"; 308 | }; 309 | name = Release; 310 | }; 311 | /* End XCBuildConfiguration section */ 312 | 313 | /* Begin XCConfigurationList section */ 314 | 67907C161CD06C53001E74F1 /* Build configuration list for PBXProject "STScrollBarDemo" */ = { 315 | isa = XCConfigurationList; 316 | buildConfigurations = ( 317 | 67907C301CD06C53001E74F1 /* Debug */, 318 | 67907C311CD06C53001E74F1 /* Release */, 319 | ); 320 | defaultConfigurationIsVisible = 0; 321 | defaultConfigurationName = Release; 322 | }; 323 | 67907C321CD06C53001E74F1 /* Build configuration list for PBXNativeTarget "STScrollBarDemo" */ = { 324 | isa = XCConfigurationList; 325 | buildConfigurations = ( 326 | 67907C331CD06C53001E74F1 /* Debug */, 327 | 67907C341CD06C53001E74F1 /* Release */, 328 | ); 329 | defaultConfigurationIsVisible = 0; 330 | }; 331 | /* End XCConfigurationList section */ 332 | }; 333 | rootObject = 67907C131CD06C53001E74F1 /* Project object */; 334 | } 335 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // STScrollBarDemo 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STScrollBar on 16/4/27. 6 | // Copyright © 2016年 沈兆良. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // STScrollBarDemo 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STScrollBar on 16/4/27. 6 | // Copyright © 2016年 沈兆良. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo/STScrollBar/STScrollBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // STScrollBar.h 3 | // STScrollBarDemo 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STScrollBar on 16/4/27. 6 | // Copyright © 2016年 沈兆良. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | @interface STScrollBar : UIView 13 | /** 1.标题,必须设在frame之后,如果重新设置字体的属性,请将标题内容在之后设置*/ 14 | @property (nonatomic, strong) NSString *text; 15 | /** 2.滚动一圈的时间, 默认是标题长度的五分之一, 如果重新设置,在设置完标题text属性之后*/ 16 | @property (nonatomic, assign) NSTimeInterval time; 17 | /** 3.字体,默认是[UIFont systemFontOfSize:17] */ 18 | @property (nonatomic, strong) UIFont *font; 19 | /** 4.字体颜色,默认是[UIColor whiteColor]*/ 20 | @property (nonatomic, strong) UIColor *colorText; 21 | /** 5.开始动画,默认是YES, 1.如果内容的长度小于frame的width,将不会滚动.2.必须先设置内容 */ 22 | @property (nonatomic, assign, getter=isStart) BOOL start; 23 | @end 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo/STScrollBar/STScrollBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // STScrollBar.m 3 | // STScrollBarDemo 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STScrollBar on 16/4/27. 6 | // Copyright © 2016年 沈兆良. All rights reserved. 7 | // 8 | 9 | #import "STScrollBar.h" 10 | #import "UIView+ST.h" 11 | NS_ASSUME_NONNULL_BEGIN 12 | @interface STScrollBar() 13 | /** 1.前面的文本框 */ 14 | @property (nonatomic, strong) UILabel *labelFront; 15 | /** 2.后面的文本框 */ 16 | @property (nonatomic, strong) UILabel *labelBack; 17 | /** 3.内容的宽度 */ 18 | @property (nonatomic, assign) CGFloat widthContent; 19 | @end 20 | NS_ASSUME_NONNULL_END 21 | 22 | @implementation STScrollBar 23 | 24 | #pragma mark - --- init 视图初始化 --- 25 | 26 | - (instancetype)init 27 | { 28 | self = [super init]; 29 | if (self) { 30 | [self setupUI]; 31 | } 32 | return self; 33 | } 34 | 35 | - (instancetype)initWithCoder:(NSCoder *)coder 36 | { 37 | self = [super initWithCoder:coder]; 38 | if (self) { 39 | [self setupUI]; 40 | } 41 | return self; 42 | } 43 | 44 | - (instancetype)initWithFrame:(CGRect)frame 45 | { 46 | self = [super initWithFrame:frame]; 47 | if (self) { 48 | [self setupUI]; 49 | } 50 | return self; 51 | } 52 | 53 | - (void)setupUI 54 | { 55 | _font = [UIFont systemFontOfSize:17]; 56 | _colorText = [UIColor whiteColor]; 57 | _start = YES; 58 | _text = @""; 59 | self.backgroundColor = [UIColor blackColor]; 60 | self.clipsToBounds = YES; 61 | [self addSubview:self.labelFront]; 62 | [self addSubview:self.labelBack]; 63 | } 64 | 65 | - (void)reloadFrame 66 | { 67 | self.labelFront.text = self.text; 68 | self.labelBack.text = self.text; 69 | self.time = self.text.length / 5; 70 | self.widthContent = [self.labelFront sizeThatFits:CGSizeZero].width; 71 | self.labelFront.frame = CGRectMake(0, 0, self.widthContent, self.height); 72 | if (self.widthContent > self.width) { 73 | self.labelBack.frame = CGRectMake(self.widthContent, 0, self.widthContent, self.height); 74 | } 75 | } 76 | #pragma mark - --- delegate 视图委托 --- 77 | 78 | #pragma mark - --- event response 事件相应 --- 79 | - (void)startAnimation { 80 | if (self.width > self.widthContent) { 81 | return; 82 | } 83 | 84 | if (self.start) { 85 | [UIView transitionWithView:self 86 | duration:self.time 87 | options:UIViewAnimationOptionCurveLinear 88 | animations:^{ 89 | self.labelBack.x -= self.widthContent; 90 | self.labelFront.x -= self.widthContent; 91 | } completion:^(BOOL finished) { 92 | self.labelBack.x += self.widthContent; 93 | self.labelFront.x += self.widthContent; 94 | [self startAnimation]; 95 | }]; 96 | } 97 | } 98 | 99 | 100 | #pragma mark - --- private methods 私有方法 --- 101 | 102 | #pragma mark - --- setters 属性 --- 103 | - (void)setFont:(UIFont *)font 104 | { 105 | _font = font; 106 | self.labelBack.font = font; 107 | self.labelFront.font = font; 108 | } 109 | 110 | - (void)setColorText:(UIColor *)colorText 111 | { 112 | _colorText = colorText; 113 | self.labelFront.textColor = colorText; 114 | self.labelBack.textColor = colorText; 115 | } 116 | 117 | - (void)setText:(NSString *)text 118 | { 119 | _text = text; 120 | [self reloadFrame]; 121 | [self startAnimation]; 122 | } 123 | 124 | - (void)setTime:(NSTimeInterval)time 125 | { 126 | _time = time; 127 | [self startAnimation]; 128 | } 129 | 130 | - (void)setStart:(BOOL)start 131 | { 132 | _start = start; 133 | [self reloadFrame]; 134 | [self startAnimation]; 135 | } 136 | 137 | #pragma mark - --- getters 属性 — 138 | - (UILabel *)labelFront 139 | { 140 | if (!_labelFront) { 141 | _labelFront = [[UILabel alloc]init]; 142 | _labelFront.textColor = self.colorText; 143 | _labelFront.font = self.font; 144 | } 145 | return _labelFront; 146 | } 147 | 148 | - (UILabel *)labelBack 149 | { 150 | if (!_labelBack) { 151 | _labelBack = [[UILabel alloc]init]; 152 | _labelBack.textColor = self.colorText; 153 | _labelBack.font = self.font; 154 | } 155 | return _labelBack; 156 | } 157 | 158 | @end 159 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo/STScrollBar/UIView+ST.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+ST.h 3 | // STScrollBarDemo 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STScrollBar on 16/4/27. 6 | // Copyright © 2016年 沈兆良. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (ST) 12 | /** 13 | * 1.间隔X值 14 | */ 15 | @property (nonatomic, assign) CGFloat x; 16 | 17 | /** 18 | * 2.间隔Y值 19 | */ 20 | @property (nonatomic, assign) CGFloat y; 21 | 22 | /** 23 | * 3.宽度 24 | */ 25 | @property (nonatomic, assign) CGFloat width; 26 | 27 | /** 28 | * 4.高度 29 | */ 30 | @property (nonatomic, assign) CGFloat height; 31 | 32 | /** 33 | * 5.中心点X值 34 | */ 35 | @property (nonatomic, assign) CGFloat centerX; 36 | 37 | /** 38 | * 6.中心点Y值 39 | */ 40 | @property (nonatomic, assign) CGFloat centerY; 41 | 42 | /** 43 | * 7.尺寸大小 44 | */ 45 | @property (nonatomic, assign) CGSize size; 46 | 47 | /** 48 | * 8.起始点 49 | */ 50 | @property (nonatomic, assign) CGPoint origin; 51 | 52 | /** 53 | * 9.上 54 | */ 55 | @property (nonatomic) CGFloat top; 56 | 57 | /** 58 | * 10.下 59 | */ 60 | @property (nonatomic) CGFloat bottom; 61 | 62 | /** 63 | * 11.左 64 | */ 65 | @property (nonatomic) CGFloat left; 66 | 67 | /** 68 | * 12.右 69 | */ 70 | @property (nonatomic) CGFloat right; 71 | 72 | @end 73 | 74 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo/STScrollBar/UIView+ST.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+ST.m 3 | // STScrollBarDemo 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STScrollBar on 16/4/27. 6 | // Copyright © 2016年 沈兆良. All rights reserved. 7 | // 8 | 9 | #import "UIView+ST.h" 10 | 11 | @implementation UIView (ST) 12 | 13 | - (void)setX:(CGFloat)x 14 | { 15 | CGRect frame = self.frame; 16 | frame.origin.x = x; 17 | self.frame = frame; 18 | } 19 | 20 | - (void)setY:(CGFloat)y 21 | { 22 | CGRect frame = self.frame; 23 | frame.origin.y = y; 24 | self.frame = frame; 25 | } 26 | 27 | - (CGFloat)x 28 | { 29 | return self.frame.origin.x; 30 | } 31 | 32 | - (CGFloat)y 33 | { 34 | return self.frame.origin.y; 35 | } 36 | 37 | - (void)setWidth:(CGFloat)width 38 | { 39 | CGRect frame = self.frame; 40 | frame.size.width = width; 41 | self.frame = frame; 42 | } 43 | 44 | - (void)setHeight:(CGFloat)height 45 | { 46 | CGRect frame = self.frame; 47 | frame.size.height = height; 48 | self.frame = frame; 49 | } 50 | 51 | - (CGFloat)height 52 | { 53 | return self.frame.size.height; 54 | } 55 | 56 | - (CGFloat)width 57 | { 58 | return self.frame.size.width; 59 | } 60 | 61 | - (UIView * (^)(CGFloat x))setX 62 | { 63 | return ^(CGFloat x) { 64 | self.x = x; 65 | return self; 66 | }; 67 | } 68 | 69 | - (void)setCenterX:(CGFloat)centerX 70 | { 71 | CGPoint center = self.center; 72 | center.x = centerX; 73 | self.center = center; 74 | } 75 | 76 | - (CGFloat)centerX 77 | { 78 | return self.center.x; 79 | } 80 | 81 | - (void)setCenterY:(CGFloat)centerY 82 | { 83 | CGPoint center = self.center; 84 | center.y = centerY; 85 | self.center = center; 86 | } 87 | 88 | - (CGFloat)centerY 89 | { 90 | return self.center.y; 91 | } 92 | 93 | - (void)setSize:(CGSize)size 94 | { 95 | CGRect frame = self.frame; 96 | frame.size = size; 97 | self.frame = frame; 98 | } 99 | 100 | - (CGSize)size 101 | { 102 | return self.frame.size; 103 | } 104 | 105 | - (void)setOrigin:(CGPoint)origin 106 | { 107 | CGRect frame = self.frame; 108 | frame.origin = origin; 109 | self.frame = frame; 110 | } 111 | 112 | - (CGPoint)origin 113 | { 114 | return self.frame.origin; 115 | } 116 | 117 | - (CGFloat)left { 118 | return self.frame.origin.x; 119 | } 120 | 121 | - (void)setLeft:(CGFloat)x { 122 | CGRect frame = self.frame; 123 | frame.origin.x = x; 124 | self.frame = frame; 125 | } 126 | 127 | - (CGFloat)top { 128 | return self.frame.origin.y; 129 | } 130 | 131 | - (void)setTop:(CGFloat)y { 132 | CGRect frame = self.frame; 133 | frame.origin.y = y; 134 | self.frame = frame; 135 | } 136 | 137 | - (CGFloat)right { 138 | return self.frame.origin.x + self.frame.size.width; 139 | } 140 | 141 | - (void)setRight:(CGFloat)right { 142 | CGRect frame = self.frame; 143 | frame.origin.x = right - frame.size.width; 144 | self.frame = frame; 145 | } 146 | 147 | - (CGFloat)bottom { 148 | return self.frame.origin.y + self.frame.size.height; 149 | } 150 | 151 | - (void)setBottom:(CGFloat)bottom { 152 | CGRect frame = self.frame; 153 | frame.origin.y = bottom - frame.size.height; 154 | self.frame = frame; 155 | } 156 | 157 | 158 | - (UIView *(^)(UIColor *color)) setColor 159 | { 160 | return ^ (UIColor *color) { 161 | self.backgroundColor = color; 162 | return self; 163 | }; 164 | } 165 | 166 | - (UIView *(^)(CGRect frame)) setFrame 167 | { 168 | return ^ (CGRect frame) { 169 | self.frame = frame; 170 | return self; 171 | }; 172 | } 173 | 174 | - (UIView *(^)(CGSize size)) setSize 175 | { 176 | return ^ (CGSize size) { 177 | self.bounds = CGRectMake(0, 0, size.width, size.height); 178 | return self; 179 | }; 180 | } 181 | 182 | - (UIView *(^)(CGPoint point)) setCenter 183 | { 184 | return ^ (CGPoint point) { 185 | self.center = point; 186 | return self; 187 | }; 188 | } 189 | 190 | - (UIView *(^)(NSInteger tag)) setTag 191 | { 192 | return ^ (NSInteger tag) { 193 | self.tag = tag; 194 | return self; 195 | }; 196 | } 197 | 198 | @end 199 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // STScrollBarDemo 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STScrollBar on 16/4/27. 6 | // Copyright © 2016年 沈兆良. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // STScrollBarDemo 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STScrollBar on 16/4/27. 6 | // Copyright © 2016年 沈兆良. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "STScrollBar.h" 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | #pragma mark - --- init 视图初始化 --- 18 | 19 | - (void)viewDidLoad 20 | { 21 | [super viewDidLoad]; 22 | STScrollBar *bar = [[STScrollBar alloc]initWithFrame:CGRectMake(0, 40, self.view.frame.size.width, 40)]; 23 | 24 | bar.text = @"买不买没关系到屋里瞧一瞧到屋里看一看 本店所有商品全场卖两块都卖两块 挑啥都两块 买啥都两块 挑啥,拿啥,买啥都两块 原价都是十块八块的 现在全场卖两块 两块钱处理,两块钱甩卖 真正的清仓,真正的甩货 你不用问价,也不用讲价 也不怕被宰 全场卖两块买啥都两块 随便挑随便选 全场卖两块买啥都两块 两块钱你买不了吃亏, 两块钱你买不了上当 真正的物有所值 拿啥啥便宜 买啥啥贱 都两块 买啥都两块全场卖两块 挑啥 拿啥 买啥都两块 随便挑随便选都两块 "; 25 | [self.view addSubview:bar]; 26 | 27 | UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, 200)]; 28 | imageView.image = [UIImage imageNamed:@"picture0"]; 29 | imageView.contentMode = UIViewContentModeScaleToFill; 30 | [self.view addSubview:imageView]; 31 | } 32 | 33 | #pragma mark - --- delegate 视图委托 --- 34 | 35 | #pragma mark - --- event response 事件相应 --- 36 | 37 | #pragma mark - --- private methods 私有方法 --- 38 | 39 | #pragma mark - --- setters 属性 --- 40 | 41 | #pragma mark - --- getters 属性 — 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // STScrollBarDemo 4 | // 5 | // Created by https://github.com/STShenZhaoliang/STScrollBar on 16/4/27. 6 | // Copyright © 2016年 沈兆良. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /STScrollBarDemo/STScrollBarDemo/picture0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/szlsay/STScrollBar/f3ab8bbad5ecf07b1a04dbd47d42858218f22ec2/STScrollBarDemo/STScrollBarDemo/picture0.png -------------------------------------------------------------------------------- /gif0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/szlsay/STScrollBar/f3ab8bbad5ecf07b1a04dbd47d42858218f22ec2/gif0.gif -------------------------------------------------------------------------------- /picture0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/szlsay/STScrollBar/f3ab8bbad5ecf07b1a04dbd47d42858218f22ec2/picture0.png --------------------------------------------------------------------------------