TTTAttributedLabel link font changing when UIAlertView presents
Asked Answered
U

1

5

I have a weird problem: I have a TTTAttributedLabel with a link in it:

enter image description here

The name "bryan"is the link. When a UIAlertView is presented over this label, the font of the link changes:

enter image description here

As you can see the link lost its font size and weight. Has anyone seen this before? Is there a separate font attribute for "link in background" or something? Thanks.

Underwriter answered 21/10, 2015 at 0:8 Comment(0)
U
13

This happens when you create a link, then set linkAttributes. When the UIAlertController is presented the link becomes "inactive", and it reverts back to a default style. Setting inactiveLinkAttributes fixed this.

Source: https://github.com/TTTAttributedLabel/TTTAttributedLabel/issues/542

Underwriter answered 3/2, 2016 at 20:8 Comment(1)
This literally saved my life. I used [:] for inactiveLinkAttributes as thinking it is not necessary for me. Drove me crazy to find what the problem is when a popover or alertView is presented. Ah manOddfellow

© 2022 - 2024 — McMap. All rights reserved.