How to render stretched text in iOS?
问题 Given a rectangular area, I want to render some text using a specific font and have the rendered text fill out the rectangle . As in the image below: This is not the same as just changing font size Rendering it as a bitmap and then scale it is not an option (it looks horrible) Vector graphics is the way to do it Solution I came up with the following which seems to work for my purposes. The code draws a single line of text scaling to fill the bounds. Subclass UIView and replace drawRect as