ios - translation after rotation view using CGAffine -


i have view contain textfield. set view's orientation

(void)devicerotated:(id)sender {     uideviceorientation orientation = [[uidevice currentdevice]orientation];      if (orientation == uideviceorientationportrait)     {         cgaffinetransform affine = cgaffinetransformmakerotation (0.0);         [self.view settransform:affine];     }      if (orientation == uideviceorientationportraitupsidedown)     {         cgaffinetransform affine = cgaffinetransformmakerotation (m_pi * 180 / 180.0f);         [self.view settransform:affine];     }     else if (orientation == uideviceorientationlandscapeleft)     {         cgaffinetransform affine = cgaffinetransformmakerotation (m_pi * 90 / 180.0f);           [self.view settransform:affine];     }     else if (orientation == uideviceorientationlandscaperight)     {         cgaffinetransform affine = cgaffinetransformmakerotation ( m_pi * 270 / 180.0f);         [self.view settransform:affine];      } } 

my problem want make view move upward when keyboard appear, because textfields hidden keyboard. think have use cgaffinetransformmaketranslation, dont know how use after rotation.

can me solve problem??

we can use cgaffinetransformconcat. here code made solve problem

cgaffinetransform rotate = cgaffinetransformmakerotation (0.0); cgaffinetransform translate = cgaffinetransformmaketranslation(-5, -150); self.alertview.transform = cgaffinetransformconcat(translate, rotate); 

but still not understand, why translation in portrait orientation && portrait upside down orientation have use different point x , y. it's happen in landscape left && landscape right orientation


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -