uiimageview里面uiscrollview位置不居中
我正在使用 Objective C 为 iPhone/iPad 开发一个应用程序。在我的应用程序中,我有一个 UiScrollView,里面有一个 UIImageView。我可以滚动和缩放滚动视图内的图像。
一切正常。但我的问题是,当我在 uiscrollview 中加载图像时,它的位置位于中心位置,但不准确。
我希望我的图像应该居中对齐或位于左上角。
我已将 contentoffset 设置为 (0,0),并尝试将 AutoresizingMask 设置为不同的值。
如果有人有任何想法或解决方案,请告诉我。
I am developing an app for iPhone/iPad using Objective C. In my app I am having an UiScrollView which is having an UIImageView inside it. I can scroll and Zoom the Image inside the Scroll View.
All works fine.But my problem is that when I am loading the Image Inside a uiscrollview, its position is at something at center but not exactly.
I want that either my image should be center aligned or at the Top Left corner.
I had set the contentoffset to (0,0) and also tried setting the AutoresizingMask to different values.
Please let me know if somebody has any idea or solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
contentoffset 是滚动视图的一部分,可能不适合这种情况。如果您希望图像位于中心,请执行以下操作:
如果您希望图像位于滚动视图的左上角,请执行以下操作:
祝您好运!
contentoffset is something of the scrollview and is probably not right for this situation. If you want the image to be in the center do this:
If you want the image to be at the top left corner of the scrollview do this:
Good luck!