ios - How to disable user interaction of section index for UITableView? -


I have applied a section index to the right of the table app, which is my app I would like to disable user interaction with that section index in some circumstances, but there is no property on UITableView which allows access to the section index directly

How can I disable user interaction for the section index?

I have disabled the interaction with the table so that you can not scroll or scroll to any cell, but it still allows the section to interact with the index, so This section will scroll to each section when tapping the section.

  self.tableView.userInteractionEnabled = NO;   

If it is not possible to disable interaction with the section index, is there a way to prevent the scrolling of the table from changing? That's exactly what I wanted.

I got a solution.

Keep a BLL to know when section indexes should be disabled.

Then indexed to prevent from scrolling in tableview: sectionForSectionIndexTitle: atIndex: simply return -1 .

  - (NSInteger) Table view: (UITableView *) table view section ForSectionIndexTitle: Index on the title (NSString *): (NSInteger) Index {if (self.tableViewIsDisabled) {return -1; } ...}    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -