La alineación de texto TTStyledTextLabel no funciona cuando se usa la rotación de transformación

I am having a problem with Three20's TTSTyledTextLabel. i have specified the view like this

//iphone properties
    htmlSubtitle_ = [[TTStyledTextLabel alloc] init];
    htmlSubtitle_.font = [UIFont systemFontOfSize:14];
    htmlSubtitle_.contentInset = UIEdgeInsetsMake(2, 2, 2, 2);
    htmlSubtitle_.backgroundColor = [UIColor clearColor];
    htmlSubtitle_.textColor = [UIColor whiteColor];
    htmlSubtitle_.textAlignment = UITextAlignmentCenter;
    htmlSubtitle_.userInteractionEnabled = NO;  
    htmlSubtitle_.text = [TTStyledText textFromXHTML:@"<p><p>I dont know where this\n is going<br/> but it is ok :D</p></p>" lineBreaks:YES URLs:YES];;
    htmlSubtitle_.frame = CGRectMake(0, 390, 200, 90);
    htmlSubtitle_.backgroundColor = [UIColor greenColor];
    [self.view addSubview:htmlSubtitle_];

se parece a esto : enter image description here

And when i rotate the screen i have written this code :

else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight){
  htmlSubtitle_.frame = CGRectMake(0, 0, 90, 200);
  htmlSubtitle_.transform = CGAffineTransformMakeRotation(M_PI / 2);
  htmlSubtitle_.backgroundColor = [UIColor greenColor];

and it looks like this :

enter image description here

see the text alignment, the alignment has been changed to left instead of remaining in center. is somebody else having this problem? or am i doing something wrong?

preguntado el 04 de julio de 12 a las 05:07

1 Respuestas

I have used UIWebView to show the HTML Styled Text instead of using this TTStyledLabel crap ... Thanx everybody.

Respondido 30 ago 12, 02:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.