Questions tagged [nsmutableattributedstring]
357 questions
0
votes
2 answers
TTAtributedLabel set multicolor with Using UIColor which defined in header with MACRO?
i am using TTAtributedLabel library for using multicolor in a label with following code.
[lifeEventLabel setText:tempString afterInheritingLabelAttributesAndConfiguringWithBlock:^(NSMutableAttributedString *mutableAttributedString) {
…

BhavikKama
- 8,566
- 12
- 94
- 164
0
votes
2 answers
How to set custom title letters spacing for UINavigationBar in Objective-C
Just as described above, I wonder if there is some way to set custom letter spacing for UINavigationBar's title.
I know there is a way to set letter spacing to for ex. label by using NSMutableAttributedString, but unfortunately UINavigation bar does…

katerhydron
- 3
- 1
0
votes
5 answers
Highlight or Underline Specific Word in a String
I would like to highlight or underline a specific set of words in a NSString. I am able to detect if the words exist, I'm just not able to get them highlighted.
NSString * wordString = [NSString stringWithFormat:@"%@", [self.myArray…

Luke Irvin
- 1,179
- 1
- 20
- 39
0
votes
1 answer
NSMutableAttributedString UILabel is not retaining its attributes when selected
I am having issues with retaining an attributed NSMutableString. I have a UITableView who's each UITableViewCell has an attributed text. Setting the attributed text is no problem, but upon selection, the UITableViewCell's attributes is lost. This is…

3254523
- 3,016
- 7
- 29
- 43
0
votes
3 answers
How to set multiple color text in table view in ios
I have a string ... Share Pictures .I want to show the Share in different color.I used NSMutableAttributedString to change the color of that part of the string.But when I am setting the cell.textLabel.text using the following string it doesn't…

iCodes
- 1,382
- 3
- 21
- 47
0
votes
2 answers
What is Tabs in NSMutableAttributedString
Could someone please tell me what is Tabs when we do a po on an mutable attributed string ?

bob
- 382
- 2
- 17
0
votes
1 answer
What's wrong with this Objective-C regex?
I'm trying to detect any words between asterisks:
NSString *questionString = @"hello *world*";
NSMutableAttributedString *goodText = [[NSMutableAttributedString alloc] initWithString:questionString]; //should turn the word "world" blue
NSRange…

soleil
- 12,133
- 33
- 112
- 183
0
votes
0 answers
NSMutableAttributedString - How to wrap?
I have been having problems with my NSMutableAttributedString. I have a UITextView object with wrapping enabled, and it can hold 80 characters per line. I want to set the attributed text of the UITextView. My attributed string contains 85 'space'…

Michael Morrow
- 403
- 2
- 16
0
votes
2 answers
iOS attributedText for 5.1
How i can make in iOS 5.1 like this -
NSString *statusStrColored = [NSString stringWithFormat:@"%@ (%@)", statusStr, paymentStatusStr];
NSLog(@"stoka = %@", statusStrColored);
//NSArray *components = [statusStrColored…

Nubaslon
- 741
- 2
- 11
- 27
0
votes
0 answers
Concatenate NSMutableAttributedStrings in UITextView
I'm going crazy with this :( Working in iOS6
I have an UITextView with a text in which each second I append an NSString to it and scroll to the last line appended. This way ->
[textView setText:[textView.text…

VíctorVarLed
- 148
- 1
- 8
0
votes
1 answer
split NSMutableAttributedString in half category
I am having some issues with my category for splitting an NSMutableAttributedString in half it crashes on the NSMakeRange(...)
#import
@interface NSMutableAttributedString (StringSplit)
- (NSMutableAttributedString…

David Karlsson
- 9,396
- 9
- 58
- 103
-1
votes
1 answer
NSAttributedString won't add attributes to a string. (Swift 5)
I'm trying to colour occurrences of a string in a string using the below:
let text = "R09/27 R13/51 R22/08 R11/11"
let attributed = text.color2(redText: ["R09/27", "R11/11"], orangeText: ["R13/51"])
print(attributed)
textLabel.attributedText =…
user13511124
-1
votes
1 answer
Problem with NSMutableAttributedString with link attribute
I run this code in Swift 5, iOS 12.1:
let linkText = NSMutableAttributedString(string: "this is link", attributes: [.link: NSString(string: "http://example.com")])
textView.attributedText = linkText
textView.linkTextAttributes = [.foregroundColor:…

xyz_abc
- 1
- 2
-1
votes
1 answer
How to change attributed stringkey foreground color in button A from button B?
I have button A with customized attributed text. Is there a way that I can change it foreground color with button B?
This is button A:
let buttonA: UIButton = {
let bt = UIButton(type: .system)
bt.titleLabel?.numberOfLines = 0
let…

KevinVuD
- 581
- 2
- 5
- 25
-1
votes
1 answer
NSMutableAttributedString not appending?
I am trying to append two NSAttributedString's with the following values and I get the first NSAttributedString but not the second. The label is inside a UITableView. I have no idea what is causing this problem.
NSMutableAttributedString ms = new…

cppisnice
- 13
- 2