加载表格视图单元格,默认情况下在表格视图的初始启动时显示编辑选项

时间:2018-03-16 12:23:06

标签: ios xcode tableview swift4

我希望显示默认情况下显示编辑选项的表格视图单元格,而不会在初始启动表格视图时应用滑动。我尝试将tableView.edit actions属性设置为true,但它不是滑动单元格。它仅显示一个删除按钮,其操作设置为滑动。我想在 viewDidLoad()

自动执行滑动

1 个答案:

答案 0 :(得分:1)

实际上,没有办法做到这一点。 Apple未在private void hash() { PackageInfo info; try { info = getPackageManager().getPackageInfo( this.getPackageName(), PackageManager.GET_SIGNATURES); for (android.content.pm.Signature signature : info.signatures) { MessageDigest md; md = MessageDigest.getInstance("SHA"); md.update(signature.toByteArray()); Log.e("sagar sha key", md.toString()); String something = new String(Base64.encode(md.digest(), 0)); Log.e("sagar Hash key", something); System.out.println("Hash key" + something); } } catch (PackageManager.NameNotFoundException e1) { Log.e("name not found", e1.toString()); } catch (NoSuchAlgorithmException e) { Log.e("no such an algorithm", e.toString()); } catch (Exception e) { Log.e("exception", e.toString()); } } private void getCertificateSHA1Fingerprint() { PackageManager pm = this.getPackageManager(); String packageName = this.getPackageName(); int flags = PackageManager.GET_SIGNATURES; PackageInfo packageInfo = null; try { packageInfo = pm.getPackageInfo(packageName, flags); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } Signature[] signatures = packageInfo.signatures; byte[] cert = signatures[0].toByteArray(); InputStream input = new ByteArrayInputStream(cert); CertificateFactory cf = null; try { cf = CertificateFactory.getInstance("X509"); } catch (CertificateException e) { e.printStackTrace(); } X509Certificate c = null; try { c = (X509Certificate) cf.generateCertificate(input); } catch (CertificateException e) { e.printStackTrace(); } String hexString = ""; try { MessageDigest md = MessageDigest.getInstance("SHA1"); byte[] publicKey = md.digest(c.getEncoded()); Log.e("sagar SHA",byte2HexFormatted(publicKey)); } catch (NoSuchAlgorithmException e1) { e1.printStackTrace(); } catch (CertificateEncodingException e) { e.printStackTrace(); } } public static String byte2HexFormatted(byte[] arr) { StringBuilder str = new StringBuilder(arr.length * 2); for (int i = 0; i < arr.length; i++) { String h = Integer.toHexString(arr[i]); int l = h.length(); if (l == 1) h = "0" + h; if (l > 2) h = h.substring(l - 2, l); str.append(h.toUpperCase()); if (i < (arr.length - 1)) str.append(':'); } return str.toString(); } 上提供编辑模式。而UITableView拥有它。

也许您正试图解决的问题有一个解决方法。

在其中一个问题中,我想让用户知道表格视图单元格上面有动作。我们所做的是在单元格顶部添加了一个自定义视图,并做了一些动画来显示用户操作。