tags:

views:

15

answers:

1

Hi there

I realise you can make dimentions fluid by using the autoresizing mask to give a flexible width/height.

What about making a position fluid?

For instance if I set the centre of a UIButton at self.view.frame.size.width/2 how can I make it reposition if the view changes size?

Thanks Tom

A: 

Set the button's autoresizingMask to UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin.

Ole Begemann
ok, will this work though if the button's at `self.view.frame.size.width/4` or `(self.view.frame.size.width/4)*3`?
Thomas Clayson
yes it does :) thanks
Thomas Clayson
this has very random effects when used to reposition elements during rotation... any idea what could be causing this?
Thomas Clayson