[TIMOB-14235] iOS: Support NSAttributedString
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-11-01T17:52:05.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2013 Sprint 21, 2013 Sprint 21 API, Release 3.2.0 |
Components | iOS |
Labels | ios7, module_label, module_textarea, planning-3.2.0, qe-testadded |
Reporter | Ingo Muschenetz |
Assignee | Pedro Enrique |
Created | 2013-06-14T16:22:52.000+0000 |
Updated | 2016-05-11T15:25:10.000+0000 |
Description
Text Kit is a full-featured, high-level framework for apps that need to handle text that has all the characteristics of fine typography. Text Kit can lay out styled text into paragraphs, columns, and pages; it easily flows text around arbitrary regions such as graphics; and it manages multiple fonts.
See https://developer.apple.com/library/prerelease/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009542
PR for implementation: https://github.com/appcelerator/titanium_mobile/pull/4749
Code to test:
links would be great! check https://github.com/viezel/NappUI/
Thanks Christopher, I'll look into it. Added documentation yaml to PR.
++1 This is one of those 'holy grail' features which many of us have wanted for a very long time - particularly for thing like social networking clients. Christopher is right though. We need clickable links in the there too, which NappUI seems to have achieved. :)
Thanks for implementing this feature. I agree as well, we most definitely need clickable links :)
Oh yea...would also be great not only implement links but also event listeners.
Hi guys, I added the link functionality. This will be available for iOS 7 and above when using a TextArea with the editable property set to false. Sample code:
You can also set the property
handleLinks
to true in the TextArea to enable the default iOS behavior, which is to try to open the link, similar to Ti.Platform.openURL()Pedro, thanks for implementing! I look forward to using this when the next nightly build goes out. Cheers.
Great stuff Pedro. But isn't this possible with a Label? Would (potentially) hundreds of textAreas - one on each row of a tableView, for example (think : a Twitter/App.net client app, with clickable hashtags, mentions etc.) be a bit heavy?
PR https://github.com/appcelerator/titanium_mobile/pull/4749 merged.
@[~kosso] We have another ticket open (TIMOB-15441) where we will address some of the deficiencies we find. The text area implementation for links is pretty straightforward. We will be researching how to support link for labels.
@Vishal thanks. As mentioned before, the nappUI dropin works with labels. And also offers event listeners for the links too. https://github.com/viezel/NappUI/ Also Ti.RichText from @euphoric (Christian Sullivan - who I think now works for Appcelerator) did it with labels. It's in the MarketPlace http://www.screenr.com/ZkP8 Though I think he uses CoreText and not TextKit
What about textFields?
How can I use this feature? Is this going to the nightly builds now that it's merged to master, or do I have to wait for the next update?
Would be really useful if support for NSParagraphstyle with hyphenationFactor could be added.
Reopening ticket. Ti.UI.iOS.ATTRIBUTE_UNDERLINES_TYLE should be Ti.UI.iOS.ATTRIBUTE_UNDERLINE_STYLE. Tested on: Titanium Studio, build: 3.2.0.201310310121 SDK build: 3.2.0.v20131030184044 Device: iphone 4s (6.0.1), iphone 5s (7.0.2) Xcode: 5.0
PR for typo https://github.com/appcelerator/titanium_mobile/pull/4896
Is it possible that Ti.UI.ATTRIBUTE_LINK could respond to click events in addition to longpress? It is difficult to explain to users that they see something that looks clickable, but no, they need to longpress it.
[~iotashan] I don't believe this was addressed. Can you add a separate bug or improvement for your request?
Like Thomas mentioned, *hyphenationFactor* (Android *hyphenationFrequency*) would be really helpful to have. iOS: https://developer.apple.com/library/ios/documentation/Cocoa/Reference/ApplicationKit/Classes/NSMutableParagraphStyle_Class/#//apple_ref/occ/instp/NSMutableParagraphStyle/hyphenationFactor Android: http://developer.android.com/reference/android/widget/TextView.html#attr_android:hyphenationFrequency
Made a separate ticket for that: AC-3614