UITableView中实现ComboBox

先看看未展开时的效果图:

UITableView中实现ComboBox_第1张图片 


在来看看展开后的效果图:

UITableView中实现ComboBox_第2张图片


实现方法:

有箭头图片的cell是一个DropDownCell(一个自定义的UITableViewCell),然后就是对tableview的一些操作,

主要是

 [tableView deleteRowsAtIndexPaths:indexPathArray withRowAnimation:UITableViewRowAnimationTop];

[tableView insertRowsAtIndexPaths:indexPathArray withRowAnimation:UITableViewRowAnimationTop];

这两个方法的灵活使用,使tableview能达到展开和收起的效果。


相关代码:UITableViewComboBox

你可能感兴趣的:(c)