簡體   English   中英

android-windowSoftInputMode問題

[英]android - windowSoftInputMode issue

打開軟輸入時,如何在紅色區域顯示相對布局? 我嘗試了adjustPan和adjustResize輸入模式,但是沒有發生。 有任何想法嗎?

在此處輸入圖片說明


在此處輸入圖片說明

首先,在manifest.xml的活動中添加android:windowSoftInputMode="adjustResize"

然后創建如下所示的布局。

  • 作為父級,使用RelativeLayout
  • 放入2個子項(ScrollView和Bottom View)
  • 底視圖aligned to bottom
  • 滾動視圖位於“底部視圖”的above

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ScrollView
        android:layout_above="@+id/bottomView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        //scrollable content
    </ScrollView>

    <RelativeLayout
        android:id="@+id/bottomView"
        android:layout_alignParentBottom="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        //your bottom content
    </RelativeLayout >
</RelativeLayout>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM