Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/184.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
C# 键盘向上移动时屏幕移动不正确-android_C#_Android_Xamarin_Adjustpan - Fatal编程技术网

C# 键盘向上移动时屏幕移动不正确-android

C# 键盘向上移动时屏幕移动不正确-android,c#,android,xamarin,adjustpan,C#,Android,Xamarin,Adjustpan,我正在用Xamarin制作一个android应用程序,下面的代码是登录窗口的axml。但问题是,当我触摸密码字段时,布局不会向上移动,因此我可以看到“innskráning”按钮(登录按钮),我尝试将所有内容相对化,并在这方面做了很多更改,但没有任何效果。我的androidManifest文件中还有:android:WindowsOfInputMode=“stateVisible | adjustResize” 谁能帮帮我,我在这上面花了这么多时间 提前谢谢 <?xml version

我正在用Xamarin制作一个android应用程序,下面的代码是登录窗口的axml。但问题是,当我触摸密码字段时,布局不会向上移动,因此我可以看到“innskráning”按钮(登录按钮),我尝试将所有内容相对化,并在这方面做了很多更改,但没有任何效果。我的androidManifest文件中还有:android:WindowsOfInputMode=“stateVisible | adjustResize”

谁能帮帮我,我在这上面花了这么多时间

提前谢谢

  <?xml version="1.0" encoding="utf-8"?>
    <ScrollView xmlns:p1="http://schemas.android.com/apk/res/android"
        p1:id="@+id/scrollView"
        p1:layout_width="fill_parent"
        p1:layout_height="match_parent"
        p1:fillViewport="true">
        <LinearLayout
            p1:orientation="vertical"
            p1:layout_width="match_parent"
            p1:layout_height="match_parent"
            p1:id="@+id/linearLayout1"
            p1:background="#FFFFFF">
            <ImageView
                p1:src="@drawable/advania"
                p1:layout_width="300dp"
                p1:layout_height="180dp"
                p1:layout_marginTop="20dp"
                p1:id="@+id/imageView1"
                p1:layout_gravity="center"
                p1:layout_centerInParent="true"
                p1:background="#FFFFFF" />
            <RelativeLayout
                p1:layout_width="match_parent"
                p1:layout_height="match_parent"
                p1:id="@+id/relativeLayout2"
                p1:background="#FFFFFF"
                p1:gravity="center">
                <EditText
                    p1:layout_width="230dp"
                    p1:layout_height="42dp"
                    p1:padding="10dp"
                    p1:id="@+id/userName"
                    p1:layout_centerHorizontal="true"
                    p1:background="@drawable/rounded_edittext"
                    p1:layout_marginTop="3.3dp"
                    p1:hint="Notendanafn"
                    p1:textColor="#000"
                    p1:textSize="14dp"
                    p1:typeface="normal"
                    p1:textStyle="normal"
                    p1:drawableRight="@drawable/iconusername"
                    p1:fontFamily="HelveticaNeue" />
                <EditText
                    p1:inputType="textPassword"
                    p1:layout_width="230dp"
                    p1:layout_height="42dp"
                    p1:padding="10dp"
                    p1:layout_below="@id/userName"
                    p1:id="@+id/password"
                    p1:layout_centerHorizontal="true"
                    p1:layout_marginTop="18.8dp"
                    p1:textColor="#000"
                    p1:textSize="14dp"
                    p1:textStyle="normal"
                    p1:typeface="sans"
                    p1:drawableRight="@drawable/iconkey"
                    p1:background="@drawable/rounded_edittext"
                    p1:hint="Lykilorð"
                    p1:fontFamily="HelveticaNeue" />
                <Button
                    p1:text="Innskráning"
                    p1:layout_width="230dp"
                    p1:layout_height="42dp"
                    p1:layout_below="@id/password"
                    p1:id="@+id/logIn"
                    p1:layout_marginTop="21.7dp"
                    p1:layout_centerHorizontal="true"
                    p1:enabled="true"
                    p1:textSize="14dp"
                    p1:typeface="normal"
                    p1:textStyle="normal"
                    p1:fontFamily="HelveticaNeue"
                    p1:background="@drawable/rounded_edittext_login" />
                <TextView
                    p1:text="Version x.x.x"
                    p1:textAppearance="?android:attr/textAppearanceSmall"
                    p1:layout_width="wrap_content"
                    p1:layout_height="22.2dp"
                    p1:layout_below="@id/logIn"
                    p1:id="@+id/versionText"
                    p1:layout_centerHorizontal="true"
                    p1:layout_marginTop="20.0dp"
                    p1:layout_marginRight="0.8dp"
                    p1:fontFamily="HelveticaNeue" />
                <TextView
                    p1:text="Advania"
                    p1:textAppearance="?android:attr/textAppearanceSmall"
                    p1:layout_width="wrap_content"
                    p1:layout_height="22.2dp"
                    p1:layout_below="@id/logIn"
                    p1:id="@+id/textView1"
                    p1:layout_centerHorizontal="true"
                    p1:layout_marginTop="50.0dp"
                    p1:layout_marginRight="0.8dp"
                    p1:fontFamily="HelveticaNeue" />
            </RelativeLayout>
        </LinearLayout>
    </ScrollView>

我在活动中使用了调整大小| StateHidden 我之前做了调整大小,它也给了我同样的问题,但在添加StateHidden后,它起了作用

[Activity(Label = "MainActivity", Theme = "@style/NoActionBar", MainLauncher = true, WindowSoftInputMode = SoftInput.StateHidden | SoftInput.AdjustResize, ScreenOrientation = ScreenOrientation.Portrait)]
   public class MainActivity : Activity
{}