当前位置:网络安全 > iPhone

iPhone

  • 发布:2023-10-06 10:48

| 我有一个覆盖cameraPicker 的UIView。在此视图中,我有一个 ImageView,其中放置相机拍摄的图像(图像属性)。 当iPhone处于水平位置拍照时,图像会旋转到ImageView中。这很糟糕,因为用户看不到已拍摄的照片。 我已将这些代码行放入管理覆盖视图(文件的所有者)的 ViewController 中:
- (void)didAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    NSLog(@\"didAnimateFirstHalfOfRotationToInterfaceOrientation\");
}

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    NSLog(@\"didRotateFromInterfaceOrientation\");
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)界面方向
{
    NSLog(@\"shouldAutorotateToInterfaceOrientation\");
    返回是;
}

- (void)willAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 持续时间:(NSTimeInterval)duration
{
    NSLog(@\"willAnimateFirstHalfOfRotationToInterfaceOrientation\");
}- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 持续时间:(NSTimeInterval)duration
{
    NSLog(@\"willAnimateRotationToInterfaceOrientation\");
}

- (void)willAnimateSecondHalfOfRotationFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation 持续时间:(NSTimeInterval)duration
{
    NSLog(@\"willAnimateSecondHalfOfRotationFromInterfaceOrientation\");
}

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 持续时间:(NSTimeInterval)duration
{
    NSLog(@\"willRotateToInterfaceOrientation\");
}
即使我向 shouldAutorotateToInterfaceOrientation 返回 YES 或 NO,也不会向控制台写入任何其他日志条目。 我不太介意,但这是一个提示。我的最后一个愿望是避免图像旋转到其图像视图中。我该怎么办? 请考虑您正在回答的问题是我们正在讨论相机覆盖层,它的反应可能与正常视图不同。 ​​

相关文章