我在背景中有一个SurfaceView,我不想通过调整大小屏幕来移动它。我需要获得虚拟键盘视图或键盘高度,以便我可以将我的EditText移动到其他地方,其他视图需要在他们的位置。这是我的代码
RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_relative_layout">
<SurfaceView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_fragment_surfase_view"
/>
<LinearLayout
android:id="@+id/main_fragment_bottom_menu_layout"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="3dp"
android:paddingTop="3dp">
<Button
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:text="View My Events"
android:textSize="10sp"
android:layout_gravity="center"
android:id="@+id/main_fragment_view_my_events_button"/>
<Button
android:layout_weight="1"
android:id="@+id/main_fragment_schedule_broadcast_button"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:text="Schedule Broadcast"
android:textSize="10sp"
android:layout_gravity="center"
/>
<Button
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:text="Follow"
android:textSize="10sp"
android:layout_gravity="center"
android:id="@+id/main_fragment_follow_button"/>
<Button
android:layout_weight="1"
android:layout_gravity="center"
android:text="Go Live"
android:textSize="10sp"
android:id="@+id/main_fragment_go_live_button"
android:layout_height="wrap_content"
android:layout_width="0dp"
/>
</LinearLayout>
<EditText
android:visibility="visible"
android:id="@+id/main_screen_edit_text"
android:alpha="0.5"
android:layout_above="@id/main_fragment_bottom_menu_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_gravity="bottom"/>
<com.devsmart.android.ui.HorizontalListView
android:id="@+id/main_fragment_following_users_list"
android:layout_alignParentTop="true"
android:layout_width="fill_parent"
android:layout_height="60dp"
/>
<ListView
android:layout_below="@id/main_fragment_following_users_list"
android:layout_gravity="center"
android:id="@+id/main_fragment_chat_list_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@id/main_screen_edit_text"/>