UIWebView 不会填满屏幕
编辑:这是我自己愚蠢的结果 - 我喜欢的网站(针对 iPhone 进行了优化)没有调整大小以利用额外的空间,其他页面显示全屏。
你好,
我一直在尝试创建一个没有导航栏的视图,只有一个 UIWebView 占据整个屏幕,并带有一个退出视图的按钮。我已经设法找到隐藏导航栏的解决方案,但问题是,它在视图底部留下了 44px 的空间。所以我所拥有的是一个在屏幕上占据 460px 的 webview,然后下面只是一个白色区域。
在 Interface builder 中,我尝试编辑视图的大小,但它显示为灰色并设置为 460px。有没有办法让webview占据全部480px?
感谢您的任何建议。
克里斯
Edit: This was a result of my own stupidity - the website I was liking to (iphone optimised) was not resizing to take advantage of the extra space, other pages display full screen.
Hi,
I've been trying to create a view that has no navigation bar, just a UIWebView that takes up the entire screen with a button to exit the view. I've managed to find a solution to hiding the navigation bar, but the problem is, it leaves a 44px space at the bottom of the view. So what I have is a webview taking up 460px on the screen, then just a white area below.
In Interface builder I tried to edit the size of the view but it was greyed out and set to 460px. Is there a way to make it so the webview takes up all 480px?
Thanks for any suggestions.
Chris
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过以下方式以编程方式设置 UIVewView 的大小:
myWebView.frame = CGRectMake(0, 0, 320, 480);
并通过示例将其放置在 viewDidLoad 方法中。
You can set the size of UIVewView programmatically in this way:
myWebView.frame = CGRectMake(0, 0, 320, 480);
and place it by example in viewDidLoad method.