如何将标签文本添加到 DetailDisclosureButton? [英] How to add label text to DetailDisclosureButton?

查看:39
本文介绍了如何将标签文本添加到 DetailDisclosureButton?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 iOS Swift 2.0 应用程序.我一生都无法弄清楚如何在披露指示器 V 形之前设置 UITableViewCell 右侧的文本(除了创建自定义 cell.accessoryView).

I'm working in a iOS Swift 2.0 application. I can't figure out for the life of me on how to set the text on the right side of a UITableViewCell just before the disclosure indicator chevron (besides creating a custom cell.accessoryView).

这是设置应用"的屏幕截图,正是我想要实现的目标.

Here is a screenshot of the "Settings app" doing exactly what I'm trying to achieve.

推荐答案

在 Interface Builder 中,设置单元格时,选择 Right Detail 样式:

In Interface Builder, when setting up your cell, select the Right Detail style:

然后将值赋给 detailTextLabel 属性:

Then assign the value to the detailTextLabel property:

cell.detailTextLabel.text = "Kilroy Was Here"

这篇关于如何将标签文本添加到 DetailDisclosureButton?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆