Android несоответствие текста приложения на разных устройствах - PullRequest
0 голосов
/ 14 апреля 2020

Я новичок в разработке android, я разработал простое приложение android, в котором текст правильно выровнен на некоторых мобильных устройствах и перепутан на некоторых мобильных устройствах. Может ли кто-нибудь помочь мне определить точную причину проблемы и предоставить решение для ее решения.

Ниже конфигурации в файле build.gradle:

  • minSdkVersion 18
  • targetSdkVersion 29

Макет, используемый в действии:

  • androidx.constraintlayout.widget.ConstraintLayout

Пожалуйста, дайте мне знать, если какая-либо другая информация будет понадобиться.

1 Ответ

1 голос
/ 14 апреля 2020
    <?xml version="1.0" encoding="utf-8"?>
    <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:orientation="vertical"/>

    <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:orientation="horizontal">

                <TextView
                    android:id="@+id/emailtext"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="left" />
<EditText
                    android:id="@+id/email"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="right" />
</LinearLayout>

                 <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:orientation="horizontal">

                <TextView
                    android:id="@+id/passwordtext"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="left" />
<EditText
                    android:id="@+id/password"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="right" />
</LinearLayout>
        </ScrollView>

    </androidx.constraintlayout.widget.ConstraintLayout>
...