Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 当旋转到UIInterfaceOrientation和SCAPERight时,如何使UITextView中的文本更宽_Iphone_Uitextview_Rotation - Fatal编程技术网

Iphone 当旋转到UIInterfaceOrientation和SCAPERight时,如何使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 = [[

我将一些文本放入UITextView。现在,我想让里面的文字占据额外的空间时,设备成为地平线。但这种方式只能使画布填充所有空间,而不是文本

// 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的大小