
因为它看起来像这样;
将有“编辑”按钮.当用户点击它时,删除按钮看起来像滑动式.
有没有机会显示这样的删除按钮;
也许有一些方法可以解决它.否则,我将为此创建自定义视图.
谢谢你的建议.
- (BOol)tableVIEw:(UItableVIEw *)tableVIEw canEditRowAtIndexPath:(NSIndexPath *)indexPath { // Return YES if you want the specifIEd item to be editable. return YES;}- (voID)tableVIEw:(UItableVIEw *)tableVIEw commitEditingStyle:(UItableVIEwCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UItableVIEwCellEditingStyleDelete) { //Do something... }}- (UItableVIEwCellEditingStyle)tableVIEw:(UItableVIEw *)tableVIEw editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { return UItableVIEwCellEditingStyleDelete;}解决方法 >添加布尔属性:@property BOol dIDpressedit; >将UIbutton添加到UItableVIEwCell
>当按下编辑时,dIDpressedit变为TRUE并且UItableVIEw重新加载,这样cell.deletebutton.hIDden =!dIDpressedit;这使得所有删除按钮都可用
>按delete时,从数据源数组中删除对象,重新加载tablevIEw
希望这可以帮助
总结以上是内存溢出为你收集整理的ios – UITableViewCell,显示滑动式删除按钮,无需滑动全部内容,希望文章能够帮你解决ios – UITableViewCell,显示滑动式删除按钮,无需滑动所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)