项目作者: supudo

项目描述 :
Custom indexed scroller
高级语言: Objective-C
项目地址: git://github.com/supudo/SNIndexedScroller.git
创建时间: 2013-09-19T07:19:14Z
项目社区:https://github.com/supudo/SNIndexedScroller

开源协议:The Unlicense

下载


HTML content display, with custom scroller, showing specific sections throughout the document as markers in the scroll. On position it displays the currently scrolled section.
Section titles are parsed automatically from the document.

Usage

Add files

Add all files from the “SNIndexedScroller” into your project.

Import SNScrollView.h

  1. #import "SNScrollView.h"

Import the scroll header file into the file you’re planing to use it in.

Initialize and add to current view

  1. SNScrollView *sv = [[SNScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
  2. [sv setupSectionID:@"section"];
  3. [sv setColorScroller:[UIColor greenColor] withAlpha:.8f];
  4. [sv setColorSectionDot:[UIColor redColor] withAlpha:1];
  5. [sv setColorAccessoryView:[UIColor blueColor] withAlpha:1];
  6. [sv setFontAccessoryView:[UIFont boldSystemFontOfSize:16] withColor:[UIColor redColor]];
  7. [sv showContentWithFile:@"content.txt"];
  8. [self.view addSubview:sv];

content.txt is the file containing the HTML to be displayed. “section” is the ID tag marking each section in the document.
So for example a section could be :

  1. <strong id="section1">Lorem ipsum</strong>

or

  1. <span id="section2">Lorem ipsum</span>

Use, change, rewrite, drop me a line … whatever fits your needs :)

… THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND …