【发布时间】:2017-03-22 10:29:00
【问题描述】:
在我的 nativescript 应用程序中 - 我在屏幕底部有一个按钮。屏幕上有一个文本区域。当用户点击文本区域时,会出现一个虚拟键盘。此时,我希望底部的按钮向上移动并出现在虚拟键盘的顶部。关于如何在 android 和 iOS 中实现这一点的任何建议?
代码
<GridLayout>
<ActionBar title="" backgroundColor="#f82462" top="0" left="0">
<NavigationButton (tap)="goBack()"></NavigationButton>
</ActionBar>
<GridLayout rows="*, auto">
<GridLayout row ='0' rows="auto *" columns="">
<GridLayout row="0" rows="" columns="">
<Button text="Top Button" (tap)="goNext()"></Button>
</GridLayout>
<GridLayout row="1" backgroundColor="#f82462">
<TextView [(ngModel)]="xyz" class="input" hint="Write your question as a complete sentence.Click on camera to add images if required." returnkeyType="done" id="questionText"></TextView>
</GridLayout>
</GridLayout>
<StackLayout row='1'>
<Button text="Next" (tap)="goNext()"></Button>
</StackLayout>
</GridLayout>
【问题讨论】:
-
在这种情况下,我通常会在导航栏的右侧添加一个按钮。顺便说一句,你试过npmjs.com/package/nativescript-iqkeyboardmanager吗?
-
感谢@EddyVerbruggen 的回复。在我的 UI 中,我在操作栏中有一个搜索栏,并且无法在其中放置任何其他内容。对于 IOS,我安装了 iqkeyboard,但不幸的是,它并不能帮助我实现将按钮移动到键盘顶部的目标。
标签: nativescript angular2-nativescript nativescript-telerik-ui