Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 键盘出现时屏幕缩小_Android_Xamarin.android_Screen_Soft Keyboard_Shrink - Fatal编程技术网

Android 键盘出现时屏幕缩小

Android 键盘出现时屏幕缩小,android,xamarin.android,screen,soft-keyboard,shrink,Android,Xamarin.android,Screen,Soft Keyboard,Shrink,我在Android应用程序上有以下屏幕: 当我按下SearchView时,屏幕缩小如下: 当键盘出现时,我希望屏幕保持静止(如第一幅图所示)。 以下是我的xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" androi

我在Android应用程序上有以下屏幕:

当我按下SearchView时,屏幕缩小如下:

当键盘出现时,我希望屏幕保持静止(如第一幅图所示)。 以下是我的xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:weightSum="10"
    android:minWidth="25px"
    android:minHeight="25px">
    <SearchView
        android:minWidth="25px"
        android:minHeight="25px"
        android:background="@drawable/rounded_border"
        android:clickable="true"
        android:iconifiedByDefault="false"
        android:focusable="false"
        android:layout_weight="1"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:id="@+id/searchViewCustomers" />
    <android.support.v7.widget.RecyclerView
        android:id="@+id/customersRecyclerView"
        android:scrollbars="vertical"
        android:layout_weight="8"
        android:layout_width="match_parent"
        android:layout_height="0dp" />
    <Button
        android:text="Нов"
        android:layout_weight="1"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:id="@+id/button1" />
</LinearLayout>

我已经尝试了在互联网上找到的解决方案,但它们不适合我,可能是因为它们适用于Android(Java)。如果有一种方法比使用xml而不是C代码更好

当键盘出现时,我希望屏幕保持静止(如第一幅图所示)

如果不希望屏幕自动调整,可以将活动的
WindowSoftInputMode
设置为
SoftInput。如下所示调整Nothing

[Activity(Label = "Sample", MainLauncher = true,WindowSoftInputMode = SoftInput.AdjustNothing)]
public class MainActivity : Activity
{
    RecyclerView mRecyclerView;
    private RecyclerView.Adapter mAdapter;
    private RecyclerView.LayoutManager mLayoutManager;
    ...
}