使用变换旋转时,TTStyledTextLabel文本对齐方式不起作用

问题描述:

我遇到了Three20的TTSTyledTextLabel问题。我已指定这样使用变换旋转时,TTStyledTextLabel文本对齐方式不起作用

//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_]; 

它看起来像这样的观点: enter image description here

当我转动我写了这个代码的屏幕:

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

,它看起来是这样的:

enter image description here

查看文本对齐方式,对齐方式已更改为左侧而不是保留在中间位置。是有人有这个问题吗?或者我做错了什么?

我已经使用UIWebView来显示HTML样式文本,而不是使用此TTStyledLabel废话...感谢每个人。