ios - Changing CGRectMake (x,x,x,x) to a different location such as (y,y,y,y) -



ios - Changing CGRectMake (x,x,x,x) to a different location such as (y,y,y,y) -

i have placed button in view using cgrectmake(x,x,x,x), x beingness location , size of course. when rotate view using -(bool)shouldautorotate... want alter location of button center in portrait mode center in landscape mode. button contains info in label user sets, don't want utilize different view landscape orientation. if set in portrait , rotate horizontal? they'll lose data. question is: how move set? see code below, don't want realloc button. thanks!

// date lbldate = [[uilabel alloc] initwithframe:cgrectmake(x, y, width, height)]; lbldate.text = @"date:"; lbldate.backgroundcolor = [uicolor clearcolor]; [contentview addsubview:lbldate];

just set frame equal new rect, e.g.

lbldate.frame = cgrectmake(x,y,width,height);

ios user-interface orientation rotation cgrect

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -