重新格式化为横向视图
我从基于导航的应用程序中的字符串加载 UIWebView。 我在 UIWebView 的 header 标签中使用它:
<meta name="viewport" content="width=320,height=420,user-scalable=yes,initial-scale=1.0">
我使用 1.0 的视口,因为图像大小不必重新调整,这是没有视口的情况。 当手机旋转至横向时,窗口宽度被严重剪裁,右侧出现黑色空白。 我希望视图填充所有横向空间...并且文本填充使用此空间,而不是像纵向那样环绕。 有没有办法获得这种类型的格式?
I load a UIWebView from a string in a navigation based app. I'm using this in a UIWebView's header tag:
<meta name="viewport" content="width=320,height=420,user-scalable=yes,initial-scale=1.0">
I use viewport at 1.0 because image sizes don't have to be readjusted, which is the case without viewport. When the phone is rotated to landscape, the window width is clipped severely and I get a black void on the right side. I'd like the view to fill all the landscape space...and for text to fill use this space, rather than wrapping as much as it does in portrait. Is there a way to get that type of formatting?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于宽度为 320 的视口,您使用的比例小于 1,这很奇怪,因为设备有足够的像素来显示整个视图。 你到底想得到什么? 您希望视图仅占据屏幕的一部分吗? 不确定这是否适用于元,您将需要调整视图本身的大小。
另外,这里是语法 :
请注意,Apple 使用逗号,而您使用分号。
如果横向太大,并且您经常使用横向,只需将其全部缩小,并在纵向时偶尔缩放:-)
You are using scale less than 1 for viewport with width 320, which is strange since the device has enough pixels to show the whole view. What exactly are you trying to get? Do you want the view to occupy just a part of the screen? Not sure if this is going to work with meta, you will need to resize the view itself.
Also, here is the syntax:
Notice that Apple uses commas while you use semicolons.
If it’s too large in landscape, and you use landscape often, just make it all smaller, and occasionally zoom when in portrait :-)