使用UITableViewCellStyleValue2样式的多行UITableViewCell [英] Multi-line UITableViewCell using UITableViewCellStyleValue2 style

查看:100
本文介绍了使用UITableViewCellStyleValue2样式的多行UITableViewCell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试弄清楚如何复制UITableViewCellStyleValue2样式,以便详细文本可以是多行 - 如联系人应用中的地址单元格所示。与联系人应用程序一样,某些字段(如街道名称)是可选的;如果街道不是零,它会显示3行而不是4行。

I'm trying to figure out how to replicate the UITableViewCellStyleValue2 style so that the detail text can be multiple lines - as seen in the 'address' cells in the Contacts app. Like the Contacts app, some of the fields (like street name) are optional; so it would show say 3 lines instead of 4, if the street was not nil.

我错过了一个技巧,或者我是否需要创建自定义单元格在IB?如何确保文本和详细文本标签与其他UITableViewCellStyleValue2单元格对齐?

I'm I missing a trick, or do I have to create a custom cell in IB? How to ensure the text and detail text labels line-up with other UITableViewCellStyleValue2 cells?

感谢您的任何提示。

推荐答案

另一轮搜索发现:

http://the-lost-beauty.blogspot.com/2009/11/multi-line-uitableviewcell-using.html

快速尝试,它可以工作 - 只需稍微设置字体大小。

Quickly tried it, and it works - just need to set the font size down a bit.

这篇关于使用UITableViewCellStyleValue2样式的多行UITableViewCell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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