Question

I have put my iPhone app in landscape mode and I want to put a message in one of my views that fills the screen. As of now a 6, 10 or 12 character message only goes up to about 12 point font in portrait view in interface builder. When I build and the iPhone simulator switches to landscape the font size stays the same as in portrait and doesn't fill the view.

Was it helpful?

Solution

I think you need to detect the rotation and resize your UIView's frame accordingly.. I'm not sure if you're using a label, webview, etc.. to display this text, but resizing the UIView and the item displaying the text should cause a smooth 'text-fill'

OTHER TIPS

If you're using a UILabel for the text, you need to anchor your UILabel (or whatever you're using) to the left and the right side of the application frame in interface builder. Then you need to set the adjustsFontSizeToFitWidth to YES and I think you should be set.

UILabel's adjustsFontSizeToFitWidth doc

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top