Thursday 15 January 2015

c# - MonoTouch--Add Button At End of Dynamically Changing Table -


I'm interested in adding a button when the table is finished changing the dynamically changing table in the table. Cells have been added, but I will only see the button, when scrolls down once under the table, I am interested to tell if there is any idea about solving this problem.

UIView with UIButton Code> FooterView

  Keep TableView.TableFooterView = MyView;   

After the data cells, add UITableViewCell with the button. This should be done by UITableViewSource . It is good to move all arguments from the last cell to the intangible class, which will handle the final cell performance.

UITableViewSource ( UITableViewSourceWithFooter ), which will include the following:

  • UITableViewCell With buttons;
  • Method bool IsLastCellIndexPath (NSIndexPath IP) , which should be visible to the last cell for the NSIndexPath parameter, if She is right. Code:
      Protected Child Islassesel Indepapath (NSIndexPath IP) {return IP. Raw == GetRecordsCount (); }   
    • Abstract methods GetRecordsCount () ,
    • RowsInction By overriding method subclasses To avoid sealed they will implement the GetRecordsCount () method instead:
        Public Seal Override Ent RowsInSection (UITableView tableview, int section) {GetRecordsCount () + 1; }   

      Then apply and use the subclass of UITableViewSourceWithFooter :

      • In the GetCell Make some arguments:
          if (base.IsLastCellIndexPath {indexpath} {return base.cell_with_button;} and {return data_cell;} < In the simplest, it will be:   
          list & item; item_class & item; ... protected override GetRecordsCount () {return item. Count;}    

No comments:

Post a Comment