【发布时间】:2019-06-04 13:07:56
【问题描述】:
在 NativeScript Angular 中,我有一个包含以下代码的页面:
<DockLayout stretchLastChild="true" height=100%>
<Button dock="bottom" text="bottom" style="background-color: #AA0078;"></Button>
<TextField dock="top" hint="Search" textFieldHintColor="black"></TextField>
<Button text="fill" style="background-color: #CCFFFF;"></Button>
</DockLayout>
看起来像这样:
Image: Footer is docked to bottom of the page
但是当键盘出现时,随着页面大小的调整,页脚会显示在键盘上方。 相反,我希望页脚保持在原来的位置,在键盘下方看不见。
Image: Footer appears above keyboard
我尝试将高度设置为“screen.mainScreen.heightDIPs”,但返回的值实际上是错误的(它比一台设备上的实际应用程序窗口高度高约 80 DIP)。
谢谢
【问题讨论】:
-
在清单中的 NativeScriptActivity 标记上将 windowSoftInputMode 设置为 adjustPan (
android:windowSoftInputMode="adjustPan")。 -
谢谢!你知道有一个 iOS 等价物吗?
-
对于ios你需要使用iqkeyboardmanager插件npmjs.com/package/nativescript-iqkeyboardmanager
标签: nativescript footer nativescript-angular