2017-06-16 10 views
1

単純な問題のように見えますが、解決策が見つかりません。ソフトキーボードが表示されているときに画面の上部にアンカーを表示

マイレイアウト階層も簡単です:私はフッターのレイアウトの子であるEditTextを、持っている を:何が起こる

<RelativeLayout 
    ...> 
    <LinearLayout 
     android:id="@id/header" 
     android:layout_alignParentTop="true" 
     ...> 
    /> 
    <RecyclerView 
     ...> 
    /> 
    <RelativeLayout 
     android:id="@id/footer" 
     android:layout_alignParentBottom="true" 
     ...> 
    /> 
</RelativeLayout> 

。フォーカスが得られると、ソフトキーボードが表示され、レイアウト全体がプルアップされます。私が達成したい何

: は...、softkeyboardが表示され、ヘッダがはトップ、フッターが(ちょうど今のような)softkeyboard上に引き上げることになるのままになります、とだけリサイズ表示がされますRecyclerView

私はScrollViewと私のレイアウトを組み合わせ、windowSoftInputModeとの組み合わせの数十を試してみました...が、何も助けません。

これは簡単ではありませんか?

編集:レイアウトはあなたがあなたの全体のコードを追加することができDialogFragment

答えて

0

の内容図であり、私はそれをテストすることができ、かつ正確な問題を見つけるために私たちを助けます。私はうまくいきました。

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<RelativeLayout 
    android:id="@+id/view_header" 
    android:layout_width="match_parent" 
    android:layout_height="50dp" 
    android:layout_alignParentTop="true" 
    android:background="#00ff00" /> 

<RecyclerView 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@id/view_header" 
    android:layout_above="@+id/view_footer" 
    android:background="#006655"/> 

<RelativeLayout 
    android:id="@+id/view_footer" 
    android:layout_width="match_parent" 
    android:layout_height="50dp" 
    android:layout_alignParentBottom="true" 
    android:background="#009911" > 

    <EditText 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" /> 


</RelativeLayout> 

下記の私の答えをチェック
関連する問題