0

I have two relative layout at the top of my app, and a linear layout which contains edit text and one button at the bottom of bottom of my app, when i click the edit text to input some words the soft keyboard show and pushes the top of layout up.

This is normal status view :Normal status

This is keyboard pop up view:Keyboard pop up view

I actually want it to remain two relative layout at the top of the screen. In spite of i have make some attempts as mentioned as:

Android: How do I prevent the soft keyboard from pushing my view up?

How to avoid soft keyboard pushing up my layout? [duplicate]

By setting activity android windowSoftInputMode="adjustPan" or "adjustRersize" or "adjustNothing" in manifest file are not working

What's more, i have try to use scroll view to solve this problem, but this problem still exits. How can i do? Could you help me?

Below is my xml layout :

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/layout_root"
    android:fitsSystemWindows="true"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <com.BC.entertainment.view.LiveSurfaceView
        android:id="@+id/videoview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true" />

    <RelativeLayout
        android:id="@+id/root_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_centerVertical="true" 
        android:layout_centerHorizontal="true"
        android:orientation="vertical" >

        <RelativeLayout
            android:id="@+id/relativelayout_head"
            android:layout_width="120dp"
            android:layout_height="40dip"
            android:layout_marginTop="10dp"
            android:layout_marginLeft="10dp"
            android:background="@drawable/fragment_top_head_bg" >

            <com.summer.view.CircularImage
                android:id="@+id/portrait"
                android:layout_width="35dip"
                android:layout_height="35dip"
                android:layout_centerVertical="true"
                android:layout_margin="2dip" />
            <TextView
                android:id="@+id/textView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignTop="@+id/portrait"
                android:layout_marginLeft="11dp"
                android:layout_toRightOf="@+id/portrait"
                android:text="直播Live"
                android:textColor="@color/white" />

            <TextView
                android:id="@+id/txtViewOnlinePeople"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignBottom="@+id/portrait"
                android:layout_alignLeft="@+id/textView1"
                android:text="0"
                android:textColor="@color/white" />
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/relativeLayout1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_below="@+id/relativelayout_head"
            android:layout_marginTop="20dp" >

            <ImageView
                android:id="@+id/imageView2"
                android:layout_width="160dp"
                android:layout_height="wrap_content"
                android:layout_alignParentStart="true"
                android:layout_alignParentTop="true"
                android:background="@drawable/fragment_value_bg" />

            <TextView
                android:id="@+id/textViewPiao"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentStart="true"
                android:layout_centerVertical="true"
                android:layout_marginStart="40dp"
                android:text="@string/fragment_total_txt_piao"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="#fefdfd" />

            <TextView
                android:id="@+id/textView_total_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentStart="true"
                android:layout_centerVertical="true"
                android:layout_marginStart="70dp"
                android:text="@string/fragment_total_value"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="#fefdfd" />

            <ImageView
                android:id="@+id/imageView_total_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentStart="true"
                android:layout_centerVertical="true"
                android:layout_marginStart="21dp"
                android:src="@drawable/fragment_money" />

            <ImageView
                android:id="@+id/imageView3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignEnd="@+id/imageView2"
                android:layout_centerVertical="true"
                android:layout_marginEnd="6dp"
                android:src="@drawable/fragment_money_right" />
        </RelativeLayout>

        <android.support.v7.widget.RecyclerView
            android:id="@+id/recyclerView"
            android:layout_width="match_parent"
            android:layout_height="40dip"
            android:layout_marginLeft="5dp"
            android:layout_above="@+id/relativeLayout1"
            android:layout_alignParentRight="true"
            android:layout_toRightOf="@+id/relativelayout_head" >
        </android.support.v7.widget.RecyclerView>
        <ScrollView
            android:id="@+id/scrollView"
            android:layout_below="@+id/relativeLayout1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:isScrollContainer="true"
            android:fillViewport="true"  >
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentStart="true" >
            <LinearLayout
                android:id="@+id/layout_input"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal|bottom"
                android:layout_marginBottom="20dp"
                android:layout_alignParentBottom="true"
                android:orientation="vertical"
                android:visibility="gone" >

                <include layout="@layout/fragment_top_surface_input" />
            </LinearLayout>
            <RelativeLayout
                android:id="@+id/layout_bottom"
                android:layout_width="match_parent"
                android:layout_height="40dp"
                android:orientation="horizontal"
                android:gravity="center_horizontal|bottom"
                android:layout_marginBottom="20dp"
                android:layout_alignParentBottom="true"
                android:layout_alignParentStart="true">

                <ImageView
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:id="@+id/imageView_chart"
                    android:src="@drawable/fragment_chart"
                    android:layout_alignParentTop="true"
                    android:layout_alignParentStart="true" />

                <ImageView
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:id="@+id/imageView_close"
                    android:src="@drawable/fragment_close"
                    android:layout_alignParentTop="true"
                    android:layout_alignParentEnd="true" />

                <ImageView
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:id="@+id/imageView_share"
                    android:src="@drawable/fragment_share"
                    android:layout_alignParentTop="true"
                    android:layout_toStartOf="@+id/imageView_close" />

                <ImageView
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:id="@+id/imageView_focus"
                    android:src="@drawable/fragment_focus"
                    android:layout_alignParentTop="true"
                    android:layout_toStartOf="@+id/imageView_share" />

                <ImageView
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:id="@+id/imageView_gift"
                    android:src="@drawable/fragment_gift"
                    android:layout_alignParentTop="true"
                    android:layout_toStartOf="@+id/imageView_focus" />

                <ImageView
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:id="@+id/imageView_camera"
                    android:src="@drawable/fragment_camera"
                    android:layout_alignParentTop="true"
                    android:layout_toStartOf="@+id/imageView_gift" />

                <ImageView
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:id="@+id/imageView_divest"
                    android:src="@drawable/fragment_divest"
                    android:layout_alignParentTop="true"
                    android:layout_toStartOf="@+id/imageView_camera" />

                <ImageView
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:id="@+id/imageView_invest"
                    android:src="@drawable/fragment_invest"
                    android:layout_alignParentTop="true"
                    android:layout_toStartOf="@+id/imageView_divest" />             
            </RelativeLayout>
            <ListView
                android:id="@+id/messageListView"
                android:layout_width="match_parent"
                android:layout_height="80dp"
                android:layout_alignParentBottom="true"
                android:layout_alignParentLeft="true"
                android:divider="@null"
                android:layout_marginBottom="90dp" >
            </ListView>
            <master.flame.danmaku.ui.widget.DanmakuView
                android:id="@+id/danmaku"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_above="@+id/messageListView"
                android:layout_alignParentLeft="true"
                android:layout_alignParentRight="true" />
        </RelativeLayout>
    </ScrollView>

    </RelativeLayout>

    <ImageView
        android:id="@+id/imageViewAnimation"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="gone"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"/>
</RelativeLayout>
Community
  • 1
  • 1

0 Answers0