Latest 0.0.2
Homepage https://github.com/litt1e-p/UIScrollView-ScrollToTopBtn
License MIT
Platforms ios 7.0, requires ARC
Frameworks Foundation, UIKit
Authors

UIScrollView-ScrollToTopBtn

a UIScrollView category for making a scroll to top button via runtime

Installation

  • use cocoapods
    pod 'UIScrollView+ScrollToTopBtn', '~> 0.0.1'
  • manual import
    just download lib folder and add into your project

Usage

  • customization for scrollToTop button, you can custom its image态title态backgroundImage or other properties as usually
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setImage:[UIImage imageNamed:@"top"] forState:UIControlStateNormal];
    //    [btn setTitle:@"go" forState:UIControlStateNormal];
    //    [btn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
  • custom some properties
    
    // frame for scrollToTop button, include the origin position and size. default size: 44.f(side length) and its margin 12.f
    self.tableView.scrollToTopBtnFrame = CGRectMake(self.view.bounds.size.width - 100, self.view.bounds.size.height - 100, 100, 100);

// offset for show/hidden the scrollToTop button, default value:[UIScreen mainScreen].bounds.size.height
self.tableView.scrollToTopBtnShowOffset = 700.f;


- set for your UIScrollView / UITableView / UICollectionView / UIWebView or other views which is subClass of UIScrollView
```swift
self.tableView.scrollToTopBtn = btn;
  • done & enjoy it

Screenshot

Release notes

  • 0.0.1

first commit

Latest podspec

{
    "name": "UIScrollView+ScrollToTopBtn",
    "version": "0.0.2",
    "summary": "a UIScrollView category for making a scroll to top button",
    "description": "a UIScrollView category for making a scroll to top button via runtime",
    "homepage": "https://github.com/litt1e-p/UIScrollView-ScrollToTopBtn",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "litt1e-p": "[email protected]"
    },
    "source": {
        "git": "https://github.com/litt1e-p/UIScrollView-ScrollToTopBtn.git",
        "tag": "0.0.2"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "UIScrollView+ScrollToTopBtn/*",
    "frameworks": [
        "Foundation",
        "UIKit"
    ]
}

Pin It on Pinterest

Share This