【问题标题】:iPhone Web application input field in a position:absolute containeriPhone Web 应用程序输入字段在一个位置:绝对容器
【发布时间】:2011-11-10 13:57:02
【问题描述】:

我为 iPhone 创建了一个群聊,它几乎完美无缺。它通过定位各种元素来使用完整的视口:

#message-input {
background: white;
clear: both;
position: absolute;
margin: 0;
width: 100%;
bottom: 0;
right: 0;
padding-right: 0;
}

这使它看起来像这样:

但是当键盘弹出时,一切都发生了变化,下面出现了一个灰色区域:

那个灰色区域的高度是状态栏的高度和调试控制台的高度一起(没有调试控制台只是状态栏的高度)。

为什么会插入这个灰色区域,我该如何避免呢?

【问题讨论】:

  • 它不再发生了:-(

标签: iphone css web-applications position


【解决方案1】:
#message-input:focus {
margin-bottom: -XXXpx;
}

其中 XXX = 问题灰色区域的高度。可以快速解决它...

【讨论】:

    猜你喜欢
    • 2017-04-17
    • 1970-01-01
    • 1970-01-01
    • 2021-04-16
    • 2021-12-27
    • 1970-01-01
    • 1970-01-01
    • 2010-10-10
    • 2011-10-01
    相关资源
    最近更新 更多