2017-04-22 2 views
0

これは私のメークアップです。アンドロイドキーボードが開いているときに、テキストの編集(ボトムコンテンツ付き)のみをプッシュアップする方法はありますか?

<?xml version="1.0" encoding="utf-8"?> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:local="http://schemas.android.com/apk/res-auto" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/chat_container" 
     android:isScrollContainer="false" 
     android:focusable="true" 
     android:background="@drawable/test_woman" 
     android:focusableInTouchMode="true"> 
     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_alignParentTop="true" 
      android:id="@+id/headerContainer" 
      android:isScrollContainer="false" 
      android:layout_height="wrap_content"> 
      <RelativeLayout 
       android:layout_height="@dimen/broadcast_live_stop_header" 
       android:layout_width="match_parent" 
       android:layout_alignParentTop="true" 
       android:background="#80000000" 
       android:paddingLeft="@dimen/activity_vertical_margin" 
       android:paddingRight="@dimen/activity_vertical_margin"> 
       <ImageView 
        android:id="@+id/camera" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_centerVertical="true" 
        android:layout_alignParentRight="true" 
        android:tint="@color/grey_camera" 
        android:src="@drawable/ic_photo_camera_white_36dp" /> 
       <Button 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:id="@+id/stopLive" 
        android:layout_centerVertical="true" 
        android:text="Stop live" 
        android:textColor="#ffffff" 
        android:layout_toLeftOf="@id/camera" 
        android:layout_marginRight="@dimen/activity_vertical_margin" 
        android:background="@drawable/red_button_shape" 
        local:MvxBind="Click StopLive" 
        android:textSize="16sp" /> 
      </RelativeLayout> 
     <!----> 
      <MvvmCross.Droid.Support.V7.RecyclerView.MvxRecyclerView 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_marginTop="@dimen/broadcast_live_stop_header" 
       android:layout_marginLeft="@dimen/chat_message_margin_left_bottom_right" 
       android:layout_marginBottom="@dimen/chat_message_container_margin_bottom" 
       android:layout_marginRight="@dimen/chat_message_margin_left_bottom_right" 
       android:id="@+id/messageList" 
       local:MvxItemTemplate="@layout/item_recycler_view" 
       local:MvxBind="ItemsSource Items" /> 
      <RelativeLayout 
       android:id="@+id/inputMessageContainer" 
       android:layout_height="@dimen/broadcast_live_stop_header" 
       android:layout_alignParentBottom="true" 
       android:layout_width="match_parent" 
       android:paddingLeft="@dimen/activity_vertical_margin" 
       android:paddingRight="@dimen/activity_margin_with_icon" 
       android:background="@color/grey_background"> 
       <ImageView 
        android:id="@+id/likeBut" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_centerVertical="true" 
        android:tint="@color/red_blur" 
        android:src="@drawable/ic_favorite" /> 
       <ImageView 
        android:id="@+id/emoji_btn" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:tint="@color/dark_grey" 
        android:layout_centerVertical="true" 
        android:layout_toRightOf="@id/likeBut" 
        android:src="@drawable/smiley" /> 
       <ImageView 
        android:id="@+id/send" 
        local:MvxBind="Click SendMessage" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_centerVertical="true" 
        android:layout_alignParentRight="true" 
        android:tint="@color/dark_grey" 
        android:src="@drawable/ic_chevron_right_white" /> 
      <!----> 
       <hani.momanii.supernova_emoji_library.Helper.EmojiconEditText 
        android:id="@+id/emojiInput" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_toLeftOf="@id/send" 
        android:layout_alignParentBottom="true" 
        android:background="@drawable/edit_text_shape" 
        android:layout_marginBottom="@dimen/chat_message_margin_bottom" 
        android:layout_marginTop="@dimen/chat_message_margin_bottom" 
        local:MvxBind="Text Message, Mode=TwoWay" 
        android:hint="Write your comment..." 
        android:layout_marginRight="@dimen/activity_margin_with_icon" 
        android:layout_marginLeft="5dp" 
        android:layout_toRightOf="@id/emoji_btn" 
        local:emojiconSize="28sp" /> 
      </RelativeLayout> 
     </RelativeLayout> 
    </RelativeLayout> 

First screenSecond screen

私はすべてを試みています:

WindowSoftInputMode = Android.Views.SoftInput.AdjustPan,
WindowSoftInputMode = Android.Views.SoftInput.AdjustResize
this.Window.SetSoftInputMode(Android.Views.SoftInput.AdjustPan).
何も、起こらない常にコンテンツがジャンプしています。私はボトムコンテンツを押し上げたいが、他のもの(バックグラウンドイメージを含む)は定位置にとどまる。助言がありますか?

答えて

0

私はあなたがについてAndroid.Views.SoftInput.AdjustPanAdjustPanを使用することによって、それはあなたのシナリオのために、キーボードを表示するページのコンテンツのサイズを変更することなく、全体のビューを移動しますが誤解かもしれないと思う:

私は下のコンテンツが押し上げが、他たいです(背景画像を含む)が適所に残る。助言がありますか?あなたが必要なもの

だけです:

this.Window.SetSoftInputMode(SoftInput.AdjustResize); 
+0

同じ結果。私はこれを試しましたが、すべてのコンテンツが画面上に飛びます。 –

+0

@TarasDidukh、あなたの3行のコードを削除し、テストしたこのコードを追加するだけで、エミュレータで正常に動作します。 –

+0

@TarasDidukh、私はこのコードをテストするために画像と下の 'EditText'を使いました、あなたは結果を見ることができます[https://i.stack.imgur.com/RQfW8.gif]、これは何ですか?あなたが必要ですか?画像全体を見て、 'EditText'だけを押し上げてください。 –

関連する問題