如何将因旋转而剪辑的图像从纵向模式滚动到横向模式

发布于 2025-01-07 16:00:48 字数 340 浏览 1 评论 0原文

我从基于分割视图的模板开始构建了一个小型演示应用程序。然后使用 IB,我将滚动视图添加到详细视图,然后将图像视图添加到滚动视图。滚动视图和图像视图的大小与详细视图相同。最后,我向图像视图添加了一个与图像视图大小相同的 png 图像。

当我运行这个应用程序时,从纵向模式开始,一切都很好。但是,当我将 ipad 旋转到横向时,我在详细视图中只能看到图像的一部分,从左上角开始,一直向下和向右移动到视图中适合的位置。我希望能够将图像的其他部分滚动到视图中,但当我尝试拖动图像时图像不会移动。我已经尝试过 IB 中可用的滚动视图和图像视图的属性,但我无法找到允许我在横向模式下滚动图像的配置。有人可以告诉我是否以及如何能够做到这一点?

谢谢

I built a small demo application by starting with a split-view based template. Then using IB I added a Scroll View to the detail view and then an Image View to the Scroll View. Both the Scroll View and the Image View are the same size as the detail view. Finally I added a png image to the Image View the was the same size as the Image View.

When I run this app, starting in portrait mode, everything is fine. But when I rotate the ipad to landscape, I see only a portion of image in the detail view, starting with the upper left corner and going as far down and to the right as will fit in the view. I would like to be able to scroll other portions of the image into view, but the image does not move when I try to drag it. I've played around with properties of the Scroll View and Image View available in IB, but I have not been able to find a configuration that allows me to scroll the image around in landscape mode. Can someone tell me whether and how I might be able to do this?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼眸里的快感 2025-01-14 16:00:48

您必须修复 UIScrollView 主子视图的支柱和弹簧。

检查 IB 中的该视图,转到“outlets”选项卡旁边的选项卡,您将看到两个框 - 一个带有 9 个点,另一个位于其下方。

默认情况下,您将看到最左上角的点被选中,请选择中间的点。

然后在下面的框中打开看起来像“I”的线:(上、左、右)。另请单击您会在那里找到的水平箭头。

希望这对您有帮助,如果您还有其他问题,请询问我。

You have to fix the struts and springs of the main sub-view of your UIScrollView.

Inspect that view in IB, go to the tab beside the outlets tab and there you'll see two boxes - the one with 9 dots and another one below it.

The default is that you'll see the uppermost left dot selected, select the one in the middle instead.

Then turn on the lines that look like 'I' in the box below it: (upper, left, right). Also click on the horizontal arrow that you'll find there.

Hope this helps, just ask me if you have further questions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文