草庐IT

ROTATION

全部标签

ios - 禁用 UI 旋转时 AVCaptureVideoPreviewLayer 方向错误

我有一个AVCaptureVideoPreviewLayer实例添加到ViewControllerView层次结构中。-(void)loadView{...self.previewLayer=[AVCaptureVideoPreviewLayerlayerWithSession:nil];self.previewLayer.frame=self.view.bounds;self.previewLayer.videoGravity=AVLayerVideoGravityResizeAspectFill;[self.view.layeraddSublayer:_previewLayer];

ios - 禁用 UI 旋转时 AVCaptureVideoPreviewLayer 方向错误

我有一个AVCaptureVideoPreviewLayer实例添加到ViewControllerView层次结构中。-(void)loadView{...self.previewLayer=[AVCaptureVideoPreviewLayerlayerWithSession:nil];self.previewLayer.frame=self.view.bounds;self.previewLayer.videoGravity=AVLayerVideoGravityResizeAspectFill;[self.view.layeraddSublayer:_previewLayer];

iphone - 在 iOS7 中处理一个 View Controller 的自动旋转

我已经阅读了很多关于SO的答案,但我似乎无法在iOS7上进行自动旋转。我只需要一个ViewController来旋转,所以我不想在我的Info.plist中设置旋转设置。据我了解Apple的文档,单个ViewController可以通过简单地覆盖两种方法来覆盖全局旋转设置(来自Info.plist)。Info.plist设置为只允许纵向,我的ViewController实现了以下方法:-(NSUInteger)supportedInterfaceOrientations{NSLog(@"%s",__PRETTY_FUNCTION__);returnUIInterfaceOrientat

iphone - 在 iOS7 中处理一个 View Controller 的自动旋转

我已经阅读了很多关于SO的答案,但我似乎无法在iOS7上进行自动旋转。我只需要一个ViewController来旋转,所以我不想在我的Info.plist中设置旋转设置。据我了解Apple的文档,单个ViewController可以通过简单地覆盖两种方法来覆盖全局旋转设置(来自Info.plist)。Info.plist设置为只允许纵向,我的ViewController实现了以下方法:-(NSUInteger)supportedInterfaceOrientations{NSLog(@"%s",__PRETTY_FUNCTION__);returnUIInterfaceOrientat

ios - 横向 xib 显示为纵向

我有一个ViewController和单独的纵向和横向nib文件。在旋转时,我加载相应的Nib。方法shouldAutorotateToInterfaceOrientationandwillRotateToInterfaceOrientation被调用并且Nib确实改变了。问题:thelandscapenibdoesnotappearaslandscape,butportrait!Thestatusbariscorrectlyrotatedandappearsonthetop:(Sorry,couldn'tpastetheimage,becausemyaccountisnew.Thes

ios - 横向 xib 显示为纵向

我有一个ViewController和单独的纵向和横向nib文件。在旋转时,我加载相应的Nib。方法shouldAutorotateToInterfaceOrientationandwillRotateToInterfaceOrientation被调用并且Nib确实改变了。问题:thelandscapenibdoesnotappearaslandscape,butportrait!Thestatusbariscorrectlyrotatedandappearsonthetop:(Sorry,couldn'tpastetheimage,becausemyaccountisnew.Thes

ios - iOS8下CGAffineTransform Make Rotation和Auto Layout问题

在简单的UIView上应用旋转变换之后CGAffineTransformtrans=CGAffineTransformMakeRotation(M_PI*-0.5);simpleVIew_.transform=trans;有以下约束[selfaddConstraints:@[[NSLayoutConstraintconstraintWithItem:simpleView_attribute:NSLayoutAttributeWidthrelatedBy:NSLayoutRelationEqualtoItem:nilattribute:NSLayoutAttributeNotAnAttr

ios - iOS8下CGAffineTransform Make Rotation和Auto Layout问题

在简单的UIView上应用旋转变换之后CGAffineTransformtrans=CGAffineTransformMakeRotation(M_PI*-0.5);simpleVIew_.transform=trans;有以下约束[selfaddConstraints:@[[NSLayoutConstraintconstraintWithItem:simpleView_attribute:NSLayoutAttributeWidthrelatedBy:NSLayoutRelationEqualtoItem:nilattribute:NSLayoutAttributeNotAnAttr

ios - 态度改变 - 角度和轴问题 - 四元数数学

我有一个应用程序可以记录用户在物体周围走动时的角度,同时将设备(最好)指向物体的中心。角度根据用户命令重置-因此引用姿态被重置。使用欧拉角会产生万向节锁,所以我目前正在使用四元数并以这种方式计算角度:doubleangleFromLastPosition=acos(fromLastPositionAttitude.quaternion.w)*2.0f;这提供了良好的精度,如果设备的俯仰和偏航不改变,它可以完美地工作。换句话说,当角度显示为360度时,我最终到达的位置与圆的起点相同。问题1:如果设备的偏航和俯仰略有变化(用户没有直接指向对象的中心),angleFromLastPositi

ios - 态度改变 - 角度和轴问题 - 四元数数学

我有一个应用程序可以记录用户在物体周围走动时的角度,同时将设备(最好)指向物体的中心。角度根据用户命令重置-因此引用姿态被重置。使用欧拉角会产生万向节锁,所以我目前正在使用四元数并以这种方式计算角度:doubleangleFromLastPosition=acos(fromLastPositionAttitude.quaternion.w)*2.0f;这提供了良好的精度,如果设备的俯仰和偏航不改变,它可以完美地工作。换句话说,当角度显示为360度时,我最终到达的位置与圆的起点相同。问题1:如果设备的偏航和俯仰略有变化(用户没有直接指向对象的中心),angleFromLastPositi