UILabel的更多按钮,如AppStore的任何应用说明
问题说明
我有myObject的描述,我在UILabel中显示它。如果描述太长,我想在我的 UILabel
中添加更多按钮。在Github上我找到了 TTTAttributedLabel ,它允许使用超链接。问题是, UILabel
或 UITextView
中是否有一些特殊功能可以解决我的问题,或者我必须使用 TTTAttributedLabel
?
I have a description of myObject and i show it in UILabel. I want to add 'More' button to my UILabel
if a description is too long. On Github i have found TTTAttributedLabel which allows to use hyperlinks. The question is, is there some special features in UILabel
or UITextView
to resolve my issue or i have to use TTTAttributedLabel
?
正确答案
最好的选择肯定是使用 TTTAttributedLabel
。
The best option is certainly to use TTTAttributedLabel
.
UILabel
和 UITextView
仅用于显示静态文本。没有添加可点击元素的方法。
UILabel
and UITextView
are designed simply for showing static text. There is no method for adding tappable elements.
作为替代方案,在我倾向于 TTTAttributedLabel
之前我只是放了一个 UIButton
在我的 UILabel
上使用自定义样式。按钮是看不见的,但仍然响应水龙头(领头)(领头)。这对于静态文本最有效,因为按钮需要正确放置在界面上以覆盖文本的正确部分。
As an alternative, before I leaned of TTTAttributedLabel
I simply placed a UIButton
with a custom style over my UILabel
. The button was invisible but still responded to taps. This works best for static text though, as the button needs to be placed correctly on the interface to cover the correct part of the text.
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tanhcfiebf
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20