Iphone 当旋转到UIInterfaceOrientation和SCAPERight时,如何使UITextView中的文本更宽
我将一些文本放入UITextView。现在,我想让里面的文字占据额外的空间时,设备成为地平线。但这种方式只能使画布填充所有空间,而不是文本Iphone 当旋转到UIInterfaceOrientation和SCAPERight时,如何使UITextView中的文本更宽,iphone,uitextview,rotation,Iphone,Uitextview,Rotation,我将一些文本放入UITextView。现在,我想让里面的文字占据额外的空间时,设备成为地平线。但这种方式只能使画布填充所有空间,而不是文本 // This method is called by NSNotificationCenter when the device is rotated. -(void) receivedRotate: (NSNotification*) notification { UIDeviceOrientation interfaceOrientation = [[
// This method is called by NSNotificationCenter when the device is rotated.
-(void) receivedRotate: (NSNotification*) notification
{
UIDeviceOrientation interfaceOrientation = [[UIDevice currentDevice] orientation];
if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft)
{
self.view.transform = CGAffineTransformMakeRotation(-M_PI/2);
self.view.bounds = CGRectMake(0, 0, 416, 320);
您是否在视图中使用xibs和interface builder?如果是这样,您应该能够使用自动调整UITextView的大小 如果没有,则必须在
receivedRotate:
方法中以编程方式重置UITextView的大小