views:

109

answers:

2

Hi,

I have a UILabel inside a UIView and I want the label to be resized proportionally as the UIView is resize. I was able to do so with a UIImageView but the label stays as big as I placed it in IB.

I have set the view contentMode to UIViewContentModeScaleAspectFit thinking that anything inside the UIView would be "aspect fit" but I had to set the same mode to the UIImageView (which works fine) and I can't set that mode to the UILabel.

Thanks for your help.

A: 

set setAutoresizingMask of label

GameBit
I tried that but couldn't get the result I'm looking for
DEIONaLiMs
A: 

It appears CGAffineTransform is the answer.

myView.transform = CGAffineTransformMakeScale(0.5, 0.5);

This would resize the view and everything that is inside dividing the view width and height by 2.

DEIONaLiMs