简体   繁体   中英

SWIFT - NUMERIC SCROLL for UITableView

In the Screen below I am trying to add a numeric indexing type of scroll if that makes any sense. I am looking to make the following cells represent page numbers so if one decides to scroll instead of search they can see which number they're up while scrolling?

Any help is much appreciated. Thank you in advance :D

在此处输入图片说明

  • for display on which number user is currently you have to find out tblView?.visibleCells which returns all visible cell yue its first object to display your index (or you can use minimum indexpath.row value from visibleCells) and this method should written in ScrollViewDidEndScroll delegate method

  • for going to any index(type in search box) you can use

    let newIndex = NSIndexPath(forItem:2, inSection:0) as NSIndexPath tblView?.scrollToRowAtIndexPath(newIndex, atScrollPosition: UITableViewScrollPosition.Top, animated: true)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM