dimanche 1 mars 2015

UIView subview of another UIView which is subview of UIViewController, not getting centered to UIViewController in iOS

I have a UIView( named fwd2) which is added as subview of a UIView(named fwd1) and this UIView is added as a subview to a UIViewController(LoginView Controller).UIView(fwd1) is of dynamic height and UIView(Fwd2)is of fixed height.Now I want both the UIViews (fwd1 & fwd2) center to the UIViewController(LoginView Controller). My first UIView(fwd1) is getting centered to the UIViewController but second UIView (fwd2) is not getting centered. I have used


fwd1.center = self.view.center;


and also i have also tried


fwd1.center = [self.view convertPoint:self.view.center fromView:self.view.superview];


but my second UIView i.e. fwd2 is not getting centered to UIViewController. Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire