I am working on autoLayout
in iOS6
. I wanted to reduce(minimize) size(frame) of UIView
. Currently my view is 320X480. I wanted to make it 160X240 keeping center point as it is.
Added NSLayoutConstraints
(add vertical and horizonatal space to superview) and also took IBOutlets
as follows :
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *topSpace;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *rightSpace;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *bottomSpace;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *leftSpace;
Do I need to apply width and height constraints also? How should I get frame size of 160X240 (keeping center point same) using this? Or I am going wrong. Please guide me.