android - 位置 - ScrollView を含むアクティビティで adjustPan を強制的に使用する
recyclerview keyboard scroll (2)
私のレイアウトはこんな感じです:
<RelativeLayout>
<RelativeLayout>
</RelativeLayout>
<ViewFlipper>
<ScrollView>
<LinearLayout>
<EditText />
</LinearLayout>
</ScrollView>
</ViewFlipper>
<RelativeLayout>
</RelativeLayout>
</RelativeLayout>
真ん中のEditTextにフォーカスすると、ソフトキーボードが期待通りにポップアップしますが、マニフェストにandroid:windowSoftInputMode="adjustPan"
がある場合でも、ソフトキーボードはレイアウトのサイズを常に変更します。
サイズ変更の問題点は、ScrollViewだけが縮小され、その上下のRelativeLayoutsが変更されずに残り、EditTextがほとんど見えなくなることです。
私はキーボードが表示されているときにRelativeLayoutsを隠してみました(これはまた悲しい話です)が、adjustPanの方が適しているようです。 しかし、それはこの活動に影響を与えません。
ScrollViewがあってもadjustPanを強制的に機能させるにはどうすればよいですか?
更新:
android:isScrollContainer="false"
私は私自身の質問に答えることはできませんが、解決策はandroid:isScrollContainer="false"
設定することですandroid:isScrollContainer="false"
。
https://code.i-harness.com
いい質問ですが、開発者もほとんど同じことをしますが、これは正しい方法ではありません。 これはあなたを助けるでしょう。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ViewFlipper>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<EditText />
</LinearLayout>
</ScrollView>
</ViewFlipper>
<LinearLayout>
あなたは問題を作成したことがありません垂直または水平ビューなどの向きでLinearLayoutを取る必要があります。これは非常に簡単です。
マニフェストのactivityタグでこれを試してください。
android:windowSoftInputMode="stateVisible|adjustPan"