Android Web App:位置:固定坏了? [英] Android Web App : Position:fixed broken?
问题描述
我正在为移动设备开发Web应用程序。 I
使用web应用程序,因为对我来说似乎是一个获胜的情况
必须开发一个应用程序,可以运行在iPhone /
Windows Mobile / Palm等。
I'm in the process of developping a Web Application for mobiles. I went with web applications because to me it seems a winning situation having to develop one application that could run also on iPhone / Windows Mobile / Palm etc.
我在今天做了几天的概念,想法和
设计后开始测试,我想做的是在页面的
底部有一个菜单。完全像这个iPhone底部的菜单
应用截图:
I started testing today after a few days of doing concepts, ideas and designs and what I wanted to do was have a menu that sticks at the bottom of the page. Exactly like the menu on the bottom in this iPhone application screenshot :
使用CSS,我虽然很容易做到这一点。只使用
位置:fixed; bottom:0;将会做到这一点,但我发现
它不会在移动浏览器上的行为相同
Using CSS, I though it would be really easy to do this. Only using position:fixed; bottom:0; would have done the trick but I have found it doesn't behave the same on mobile browsers
我试图拆分我的页面2部分:1是一个可滚动的div
(对于内容),另一个将是底部菜单。
可滚动div也不能在Android上工作。我也试过使用框架
没有运气。有没有人知道以任何方式重新创建一个菜单
,将坚持在手机页面的底部?
I tried to split my page in 2 sections : 1 would be a scrollable div (for the content) and the other one would be the bottom menu. Scrollable divs also do not work on Android. I also tried using frames with no luck either. Does anyone know of any way to re-create a menu that would stick to the bottom of a page for mobile phones?
推荐答案
在我的Android N1与CyanogenMod我有这个麻烦和修复:
On my Android N1 with CyanogenMod i had this trouble too and the fix:
<meta
name="viewport"
content="width=100%;
initial-scale=1;
maximum-scale=1;
minimum-scale=1;
user-scalable=no;"
/>
特别是 user-scalable = no;
部分,您还可以将 0
而不是无
。
Specifically the user-scalable=no;
part, you can also put 0
instead of no
.
有趣的是,这会打断Androids渲染的按钮,但你只需要设置一个背景颜色的按钮。
Interestingly this breaks androids rendering of buttons, but all you have to do is set a background color to buttons.
这篇关于Android Web App:位置:固定坏了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!