iphone - Determine if a tableview cell is visible -


is there way know if tableview cell visible? have tableview first cell(0) uisearchbar. if search not active, hide cell 0 via offset. when table has few rows, row 0 visible. how determine if row 0 visible or top row?

uitableview has instance method called indexpathsforvisiblerows return nsarray of nsindexpath objects each row in table visible. check method whatever frequency need , check proper row. instance, if tableview reference table, following method tell whether or not row 0 on screen:

-(bool)isrowzerovisible {   nsarray *indexes = [tableview indexpathsforvisiblerows];   (nsindexpath *index in indexes) {     if (index.row == 0) {       return yes;     }   }    return no; } 

because uitableview method returns nsindexpath, can extend sections, or row/section combinations.

this more useful visiblecells method, returns array of table cell objects. table cell objects recycled, in large tables have no simple correlation data source.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -