KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
TableViewSectionIndex
★ 11
Open GitHub ↗
解决tableviewSectionindex不能平均的问题
Download README (.md)
Explore Similar Repositories
techradar
:
Inspired by https://github.com/bdargan/techradar I'd like to create my own little techradar
td_revent
:
tickdream rust event - Async IO similar to libevent
plcb
:
Hunting for daily rarities -- boozicorns, really -- from the Pennsylvania Liquor Control Board's databases.
GRNVBEM
:
AR1MA1 - VBEM reverse engineering GRNs method
leaf
:
基于OverFeat的病斑检测系统
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
TableViewSectionIndex
?
Download (.md)
#### TableViewSectionIndex ####解决tableviewSectionindex不能平均的问题 ####1.如何使用 ```swift self.tableView.yw_index = YWIndexView.IndexViewWith(sectionTitles: self.listArray.map{ $0.letter! })! ``` ####2.如何集成到项目中 直接把UITableView+Additions.swift拖入项目中即可 ####3.对比下系统中的index和我自定义的index   StackOverFlow上的解决方法是给每一个字符后添加一个空字符,注意是数组中的元素后.这也数组长度变大,这样indexTitle中间插入一些空格索引.看起来是变长了,但是需要在返回section高度和返回sectionview以及返回section和index关联三个代理方法中分别设置对于空字符的处理.较为麻烦 而且布局也不够美观.详见[[StackOverFlow]--UITableView section index spacing on iOS 7](http://stackoverflow.com/questions/18923729/uitableview-section-index-spacing-on-ios-7) 另外也有国内开发者对这篇文章的翻译见[[4byte.cn]--在iOS 7表格部分指标间距](http://www.4byte.cn/question/481261/uitableview-section-index-spacing-on-ios-7.html) 我的方法是这样的.自定义一个indexview放在控制器上.创建多个letterLabel放在indexview上.每个letterLabel高度为indexview的高度除以数组的个数,这样就能保证indexview的高度更加填充慢屏幕.通过给indexview添加一个tap手势,再通过手势的位置算索引indexPath,然后让tableview滚动到对应的索引.