nsattributedstring Questions
3
Solved
I'm using ContextLabel to parse @ , # and URL's. This is the best solution i found, cause it sizes correctly and dont affect performance. It firstly parses string at input and than converts it to N...
Robinett asked 13/5, 2016 at 10:34
19
Solved
I have a UILabel and in some cases the text is longer then the UILabel itself, so I see the text as "bla bla bla..." I want to add a ...Read More button text at the end of the UILabel..
I've read ...
Battleax asked 31/8, 2015 at 10:33
3
Solved
I have a UITextView with attributed text and allowsEditingTextAttributes set to true.
I'm trying to convert the attributed string into a Data object, using the following code:
let text = self.tex...
Vender asked 10/4, 2017 at 0:14
5
How do I make spacing around NSTextAttachments like in the example below?
In the example No spacing is the default behaviour I get when I append a NSTextAttachment to a NSAttributedString.
Boser asked 6/1, 2017 at 8:18
18
Solved
I am using a instance of UIWebView to process some text and color it correctly, it gives the result as HTML but rather than displaying it in the UIWebView I want to display it using Core Text with ...
Forthcoming asked 18/11, 2010 at 17:38
4
Solved
All I need is to loop through all attributes of NSAttributedString and increase their font size. So far I got to the point where I successfully loop through and manipulate attributes but I cannot s...
Irvine asked 15/10, 2013 at 16:59
6
Solved
I have a NSAttributedString to which I am adding a NSTextAttachment. The image is 50w by 50h but I'd like it to scale down to reflect the line height of the attributed string. I thought this would ...
Thrasonical asked 12/3, 2014 at 16:2
3
Solved
I have a number of UILabels created in IB which all have attributed text. Each label's text contains multiple lines of different font sizes and colors.
At run-time, I want to be able to change jus...
Piperonal asked 18/2, 2017 at 17:0
35
Solved
Many applications have text and in this text are web hyperlinks in rounded rect. When I click them UIWebView opens. What puzzles me is that they often have custom links, for example if words starts...
Rutherford asked 10/8, 2009 at 19:56
9
I have a problem that boundingRectForGlyphRange always returns CGRect.zero "0.0, 0.0, 0.0, 0.0".
For example, I am coding for touching on a part of text of UILabel feature. My text has fi...
Illaffected asked 16/3, 2016 at 17:38
31
I am trying to make a simple Coffee Calculator. I need to display the amount of coffee in grams. The "g" symbol for grams needs to be attached to my UILabel that I am using to display the amount. T...
Metope asked 10/7, 2014 at 2:21
7
Solved
So I have an NSAttributedString I want to insert a bullet point at the beginning of a portion of text. How can I do this? How do I create a CTPAragraphStyle that creates this bullet point when I di...
Cunningham asked 10/7, 2011 at 23:42
2
Solved
In one of my module, I want show the multiple language HTML texts (English and Tamil) as a NSAttributedString using UILabel. If the text would be pure english, I can show it as my desire Using this...
Condyloma asked 24/5, 2018 at 10:23
3
I am wanting to create a simple label with an attributed string. I do this like this:
NSDictionary *noNotificationsAttrs = [NSDictionary dictionaryWithObjectsAndKeys:centredStyle,
NSParagraphStyle...
Bookcraft asked 22/7, 2017 at 16:12
2
let dictTitleColor = [NSAttributedStringKey.foregroundColor: UIColor.LTColor()]
let titleAttributedString = NSMutableAttributedString(string: title, attributes: dictTitleColor)
alert.setValue(title...
Amaty asked 30/11, 2017 at 8:33
15
How would it be possible to include both bold and non-bold text in a uiLabel?
I'd rather not use a UIWebView.. I've also read this may be possible using NSAttributedString but I have no idea how t...
Simpatico asked 27/8, 2010 at 17:52
10
Solved
I want to replace a substring (e.g. @"replace") of an NSAttributedString with another NSAttributedString.
I am looking for an equivalent method to NSString's stringByReplacingOccurrencesOfString:w...
Rainstorm asked 22/11, 2011 at 17:43
2
iOS 15 includes support for AttributedString
Example
struct PlaygroundView: View {
func attributedString(string: String) -> AttributedString {
var text = AttributedString(string)
text.font = ...
Revisory asked 17/1, 2022 at 19:16
8
Solved
I'm using an NSMutableAttribtuedString in order to build a string with formatting, which I then pass to Core Text to render into a frame. The problem is, that I need to use superscript and subscrip...
Dieldrin asked 6/10, 2010 at 9:51
4
Solved
I have a NSAttributedString object as a property of a custom object. I need to save this custom object to the disk in JSON format. Later I need to send this JSON data across the network to a Java S...
Humming asked 24/3, 2014 at 21:6
2
Solved
I have a UITextField on which I set a current value as attributed text as follows:
public var currentValue: NSAttributedString {
get {
return inputField.attributedText ?? NSAttributedString()
}
...
Nitroparaffin asked 14/9, 2020 at 21:52
2
Solved
In the NSAttributedString class, there are functions that get the values of attributes for certain indices and ranges but I'm unsure of the difference between the selectors attributesAtIndex:effect...
Offcolor asked 30/8, 2015 at 15:8
8
Solved
I am dinamically getting an HTML string from a Wordpress API and parsing it into an Attributed String to show it in my app. Since the string has its own styles, it shows different fonts and sizes, ...
Acceptant asked 1/1, 2017 at 2:26
8
Solved
just started swift 3 and I have problems with swift syntax.
i'm trying to display a simple NSAttributedString.
so 1st I set my attributes :
let attributeFontSaySomething : [String : AnyObject...
Inmate asked 24/11, 2016 at 11:51
3
Solved
In my iOS app I'm using NSAttributedString to generate a list of bullets. Unfortunately I'm struggling with making the bullets look presentable. My first attempt was to use regular text and a unico...
Deflective asked 25/5, 2016 at 13:3
© 2022 - 2025 — McMap. All rights reserved.