Skip to content

Latest commit

 

History

History
56 lines (36 loc) · 1.78 KB

README.md

File metadata and controls

56 lines (36 loc) · 1.78 KB

YFMetroListBox

Customer TableView IndexView just like Windows Phone.

博客园记录: 【IOS】模仿windowsphone列表索引的控件YFRollingLabel

##Effection:

Alphabet

 ![AllAlphabet](https://github.com/yvanwang1992/YFMetroListBox/blob/master/screenshots/AllAlphabet.gif)

HeaderView Label Name

 ![GroupName](https://github.com/yvanwang1992/YFMetroListBox/blob/master/screenshots/GroupName.gif)

How To Use It?

####1.#import "YFMetroListBox.h"

####2.Initialization:

//Use just like normal UITableView; YFMetroListBox *metroListBox = [[YFMetroListBox alloc] initWithFrame:frame style:style]; //or using like this (default style is UITableViewStylePlain) YFMetroListBox *metroListBox = [[YFMetroListBox alloc] initWithFrame:frame];

####3.Property:

YFMetroListBoxType metroListBoxType. set YFMetroListBoxTypeAllAlphabet: just like first picture above; set YFMetroListBoxTypeGroupName : just like second picture above;

CGSize itemSize                 //Each Item Size
CGSize interSize                //Contains InternalWidth and InternalHeight
UIColor *itemBackgroundColor	//Item Background Color

####4.protocol:

@protocol YFMetroListBoxDelegate

@required

// return list of section titles to display in index view

  • (NSArray<NSString *> *)sectionIndexTitlesForYFMetroListBox:(YFMetroListBox *)metroListBox;

    @end

    metroListBox.listBoxDelegate = self;

####5.notice:

Please make sure that the HeaderView is Visible.

You can set HeaderView using either tableView:titleForHeaderInSection: or

tableView:viewForHeaderInSection: in UIScrollViewDelegate.

And set HeaderView's Height using tableView:heightForHeaderInSection or property sectionHeaderHeight;