首页 文章

使用键盘nativescript(IOS)移动UI元素

提问于
浏览
1

在我的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>

1 回答

  • 1

    我现在无法对此进行测试,但您是否尝试将所有内容包装在 <ScrollView> ... </ScrollView> 中的主GridLayout中

相关问题