1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
      怎么在iOS中利用UITableView實(shí)現(xiàn)一個(gè)左滑刪除復(fù)制即用功能

      今天就跟大家聊聊有關(guān)怎么在iOS中利用UITableView實(shí)現(xiàn)一個(gè)左滑刪除復(fù)制即用功能,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。

      創(chuàng)新互聯(lián)建站專注于企業(yè)營銷型網(wǎng)站建設(shè)、網(wǎng)站重做改版、臨湘網(wǎng)站定制設(shè)計(jì)、自適應(yīng)品牌網(wǎng)站建設(shè)、H5網(wǎng)站設(shè)計(jì)購物商城網(wǎng)站建設(shè)、集團(tuán)公司官網(wǎng)建設(shè)、成都外貿(mào)網(wǎng)站制作、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁設(shè)計(jì)等建站業(yè)務(wù),價(jià)格優(yōu)惠性價(jià)比高,為臨湘等各大城市提供網(wǎng)站開發(fā)制作服務(wù)。

      //設(shè)Cell可編輯
      - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
      {
        return YES;
      }
      //設(shè)置刪除按鈕
      -(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
      {
        return UITableViewCellEditingStyleDelete;
      }
      //進(jìn)入編輯(刪除)模式
      -(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
      {  
        //出現(xiàn)alterView隱藏刪除按鈕
        [tableView setEditing:NO animated:YES];
        if (editingStyle == UITableViewCellEditingStyleDelete) {
          UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"你確定刪除該消息?" preferredStyle:UIAlertControllerStyleAlert];
          [alertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
          [alertController addAction:[UIAlertAction actionWithTitle:@"確定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
            //需要先刪除數(shù)據(jù)源中對應(yīng)數(shù)據(jù),不然執(zhí)行下一步會(huì)崩潰
            [reconnaissanceListArr removeObjectAtIndex:indexPath.row];
            [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
          }]];
          [self presentViewController:alertController animated:YES completion:nil];
        }
      }
      //修改編輯按鈕文字
      -(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
      {
        return @"刪除";
      }
      //設(shè)置進(jìn)入編輯狀態(tài)時(shí),Cell不會(huì)縮進(jìn)
      - (BOOL)tableView: (UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
      {
        return NO;
      }

      看完上述內(nèi)容,你們對怎么在iOS中利用UITableView實(shí)現(xiàn)一個(gè)左滑刪除復(fù)制即用功能有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。


      分享文章:怎么在iOS中利用UITableView實(shí)現(xiàn)一個(gè)左滑刪除復(fù)制即用功能
      文章地址:http://www.ef60e0e.cn/article/joocie.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        淮阳县| 夏邑县| 陇南市| 平果县| 拜城县| 喜德县| 鞍山市| 石渠县| 桓仁| 辽阳市| 阿拉善盟| 遂平县| 巨野县| 卢氏县| 章丘市| 土默特左旗| 敦化市| 东光县| 庆城县| 南宁市| 郸城县| 沧州市| 孝感市| 德惠市| 呼图壁县| 福州市| 洛川县| 凤山县| 健康| 新沂市| 康马县| 新河县| 兴和县| 永州市| 天峨县| 缙云县| 罗定市| 芜湖市| 奇台县| 奉节县| 莒南县|