0
這是我的化妝。如何在Android鍵盤打開時僅推送編輯文本(含底層內容)?
<?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>
我什麼都試過:
WindowSoftInputMode = Android.Views.SoftInput.AdjustPan,
WindowSoftInputMode = Android.Views.SoftInput.AdjustResize
this.Window.SetSoftInputMode(Android.Views.SoftInput.AdjustPan).
沒有發生,總是內容跳躍。我希望底部內容向上推,但其他(包括背景圖片)保持原樣。有什麼建議麼?
相同的結果。我試過了,但所有內容都跳過了屏幕。 –
@TarasDidukh,刪除你的三行代碼,只是添加這個代碼,我測試過,在模擬器上工作正常。 –
@TarasDidukh,我在底部使用了一個圖片和一個'EditText'來測試這段代碼,你可以看到結果[here](https://i.stack.imgur.com/RQfW8.gif),這是什麼你需要?保持整個圖像被看到,只是'EditText'被推高? –