将较小的 UIWebView 显示为表单
我试图在 iPad 上弹出一个 UIWebView,其中包含一个专门为 iPhone (320x480) 设计的网站。我希望网络视图居中,并使用缩放动画进行过渡。其他应用程序有此功能,但我似乎不知道如何做到这一点。我尝试过演示和演示的各种组合。过渡样式,但无论我做什么,Web 视图都会占据整个屏幕并垂直滑动以覆盖屏幕。我在 IB 中将 Web 视图设为 320x480,并使用 UIModalPresentationStyleFormSheet,这应该至少可以使用小窗口向上滑动到屏幕中心,但这种情况没有发生。
有人知道出了什么问题吗?
I'm trying to pop up a UIWebView on iPad with a web site that is specifically sized for the iPhone (320x480). I want the web view to be centered, and transition in using a zooming animation. Other apps have this functionality, but I can't seem to find out how to do it. I've tried various combinations of presentation & transition style, but no matter what I do, the web view takes up the entire screen and slides vertically to cover the screen. I've made the web view 320x480 in IB, and am using UIModalPresentationStyleFormSheet, which should make it at least slide up into the center of the screen using a small window, but that is not occurring.
anyone know what's wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否设置父
UIViewController
或模态UIViewController
的属性?因为您应该在呈现控制器而不是父级之前设置模态UIViewController
的属性。这可能根本没有帮助,因为您正在做正确的事情,但这是我在开始使用 MVC 时犯的第一个错误。
Are you setting the property of the parent
UIViewController
or the modalUIViewController
? Because you should be setting the properties of the modalUIViewController
before presenting the controller instead of the parent.This might be no help at all because you're doing the right thing, but it was the first error I made when starting to use MVCs.
也许设置了任何 autosize 属性。只需做一件事将您的 webview 与代码绑定并通过代码尝试设置框架。希望它能发挥作用,就像我遇到类似问题时多次发挥作用一样。
快乐编码...
maybe any of the autosize property is set. just do one thing bind your webview with the code and through code try to set the frame. Hope it will work as it worked many times to me when i faced similar types of problem.
hAPPY cODING...