微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Nativescript Android ScrollView 无法与软键盘组件一起正常工作

如何解决Nativescript Android ScrollView 无法与软键盘组件一起正常工作

我正在使用带有 angular 的 nativescript 6,在 android 上,当我打开键盘时,我无法让滚动视图工作。此外,如果我开始在文本框中键入 @ 符号以标记用户,我将显示一个组件。我不仅不能滚动,而且在选择用户后选择列表消失时,我再也看不到文本输入字段上方的内容。有没有人有建议?我尝试过使用滚动视图的布局和位置以及 AndroidManifest.XML 文件。这是我目前的代码

            
            <GridLayout rows="auto,auto">
              
              <ScrollView full-stretch row="0" #noteScrollAndroid orientation="vertical" margin="10">
                <ns-mention-list *ngIf = "searchingPickList" (sendUsers) = "matchUser($event)" [searchText] = "searchText" > </ns-mention-list>

                <ActivityIndicator col="2" *ngIf="isLoadingNotes" class="h2 text-center loader" id="activityIndicator"
                  [busy]="isLoadingNotes"></ActivityIndicator>
                <Label *ngIf="notes.length<=0 && !isLoadingNotes" text="No notes" class="h2 text-center"
                  marginTop="10"></Label>
                <StackLayout *ngIf="notes.length>0" verticalAlignment="bottom" row="1" orientation="vertical">
                  <ns-notes [notes]="notes"></ns-notes>
                </StackLayout>
             
                </ScrollView>
         
              
              <AbsoluteLayout row="1" width="100%">
                <StackLayout width="100%">
                  <Label textwrap="true" class="error" *ngIf="errorText" [text]="errorText" width="100%"></Label>
                  <TextView *ngIf="showEmails && hasAccess(['WorkOrdeRSService:NotesManualEmailEntry'])" id="adtlEmails" class="chatInput"
                    hint="Enter Additional Emails (Optional)" [(ngModel)]="adtlEmails"></TextView>
                </StackLayout>
                
 
                <GridLayout [formGroup] = "newNoteFormGroup" columns="*,50">
                  <TextField  col="0" id="submitNote" [height]="submitNoteHeight" #chatInputFieldAndroid class="chatInput"
                  formControlName="newNoteText" hint="Enter Note" (focus)="focus($event.object)"
                  (blur)="collapseHeight($event)"></TextField>
                </GridLayout>
              </AbsoluteLayout>
              
              
             
              
            </GridLayout>
            
            

          </nestedScrollView>
            
        </TabContentItem>
      </Tabs>
    </StackLayout>
  
    <KeyboardToolbar dock="bottom" anchor="bottom" *ngIf="true" forId="submitNote" class="androidToolbar">
      <GridLayout rows="*,auto" class="toolbarOutline toolbar">
        <GridLayout row="0" class="keyboardToolbar" columns="75,*,auto," class="toolbar">
          <Label col="0" text="&#xf078;" class="fa toolbarIcon" (tap)="closeKeyboard()"></Label>
          <Label col="1" text="&#xf1f8;" class="fa toolbarIcon" (tap)="clearField()"></Label>
          <Label col="2" text="&#xf1fa;" class = "fa toolbarIcon" (tap) = "tagUser(chatInputFieldAndroid)"></Label>
          <Label *ngIf="!isSendingNote" [class]="getSendButtonClass()" col="3" text="&#xf1d8;"
            (tap)="sendNote(chatInputField)"></Label>

          <ActivityIndicator col="2" *ngIf="isSendingNote" class="loader" id="activityIndicator" [busy]="isSendingNote">
          </ActivityIndicator>
        </GridLayout>
        <Label row="1" textwrap="true" class="error" *ngIf="errorText" [text]="errorText"></Label>
      </GridLayout>
    </KeyboardToolbar>
  

  </GridLayout>
  
</DockLayout> ```

Also my manifest file: 

```<activity
            android:name="com.tns.NativeScriptActivity"
            android:label="@string/title_activity_kimera"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
            android:theme="@style/LaunchScreenTheme"
        
            android:windowSoftInputMode="adjustResize|stateVisible">

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。