仅使用 Three20 的 TTStyledTextLabel
我想使用 Three20 的 TTStyledTextLabel,以便为标签提供支持,按下其中的链接将触发 safari 打开它。
问题是我担心包含整个 Three20 库有点过分了,因为除了这个功能之外它还有很多东西可以提供。
有没有办法只添加 TTStyledTextLabel 功能? 或者也许有替代解决方案?
谢谢
I want to use Three20's TTStyledTextLabel, in order to provide support for a label where pressing a link inside it will trigger safari to open it.
The problem is I'm afraid including the entire Three20 library is quite an overkill, since it has much to offer besides that capability.
Is there way to add just the TTStyledTextLabel functionality ?
Or maybe an alternative solution ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Three20 在某种程度上是模块化的,因此您可以重用您需要的内容...
对于 TTStyledTextLabel,它们属于 Three20UI 框架,这是一个相当庞大的框架,并且依赖于:Three20Core、Three20Network、Three20Style、Three20UICommon 和 Three20UINavigator。所以你在这里面临着一点复杂性......
无论如何,就 TTStyledTextLabel 而言,它派生自 UIView (而 TTLabel 派生自 TTView,因此 TTLabel 有更多的依赖项),并使用了一些属于 Three20Style 的类 - - 显然没有什么更复杂的......
所以我认为你可以尝试将这些源文件与 Three20Style 一起直接包含到你的项目中,看看会发生什么......
当然,TTStyledTextLabel 的实现文件中的某个地方会有一些依赖项,但如果它们对应于您不需要的功能,您甚至可以删除它们。
Three20 is somewhat modular, so you can just reuse what you need...
in case of TTStyledTextLabel, they belong to the Three20UI framework, which is quite a big beast and depends on: Three20Core, Three20Network, Three20Style, Three20UICommon, and Three20UINavigator. So you are facing a bit of complexity here...
Anyway, just in the case of TTStyledTextLabel, it derives from UIView (while TTLabel derives from TTView, so TTLabel has many more dependencies), and uses a few classes that belong to Three20Style -- and apparently nothing more complex...
so I think you could try and include those source files directly into your project, together with the Three20Style and see what happens...
for sure there will be some dependencies somewhere in the implementation file of TTStyledTextLabel, but you could even be able to remove those, if they correspond to functionality you don't need.