kTTTBackgroundFillColorAttributeName not working #172

Closed
RonKliffer opened this Issue Feb 8, 2013 · 4 comments

5 participants

@RonKliffer

Hi Matt,
Thanks for this great library, helped me a lot recently.

I have a question though... I'm trying to highlight part of my label using this code:

[tttTitle setText:title.text afterInheritingLabelAttributesAndConfiguringWithBlock:^ NSMutableAttributedString *(NSMutableAttributedString *mutableAttributedString) {
            NSRange titlelook = titleLookup;
            NSRange range = [titleText rangeOfString:string options:NSCaseInsensitiveSearch range:titlelook];
            while (range.location != NSNotFound) {
                [mutableAttributedString addAttribute:(NSString *)kTTTBackgroundFillColorAttributeName value:(id)[color CGColor] range:range];
                titlelook = NSMakeRange(range.location + range.length, titleLen - range.location - range.length);
                range = [titleText rangeOfString:string options:NSCaseInsensitiveSearch range:titlelook];
            }
            // Core Text APIs use C functions without a direct bridge to UIFont. See Apple's "Core Text Programming Guide" to learn how to configure string attributes.
            return mutableAttributedString;
        }];

However, my label isn't highlighted. when I use the key: kCTStrokeColorAttributeName it works fines, but kTTTBackgroundFillColorAttributeName gives me nothing.

Would appreciate your help
Thanks

@ay8s

Just been using this and it seems to be working correctly for me. Nothing obvious is wrong in your code however, is this still an issue with the latest version?

@yonivav

not working for me too, but only in ios5 (in ios6 its work fine):
[attributedString addAttribute:(NSString *)kTTTBackgroundFillColorAttributeName value:(id)backgroundRedColor.CGColor range:keyWordRange];
I would like for some help..

@jnawaz

Does not work in iOS 5, iOS 6 works as expected.

@mattt

Unable to reproduce on iOS 5 or iOS 5.1

Beyond making sure that you compile using the latest available base SDK, I don't really know what to say...

@mattt mattt closed this Oct 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment