KingPolygon
KingPolygon

Reputation: 4755

iOS: Change NSMutableAttributedString's Font Height Without Changing Font Width?

I have an NSMutableAttributedString "timeString" whom's font and color I have already set. Everything is working fine, but I was wondering if there were a way to alter the text's height without changing the text's width (font width = 100%, font height = 120%).

I tried using transform, but it's not available for NSMutableAttributedStrings. Thanks!

Upvotes: 5

Views: 148

Answers (1)

Jason Grandelli
Jason Grandelli

Reputation: 342

There is no way to apply transforms to a string as a string is not actually a UI element. Your best bet in this case is to either add the Attributed String to a UILabel, transform the label's height and then draw the label in your context. Or transform whatever context you are drawing the text into.

Upvotes: 1

Related Questions