Проблема относительности размеров приложения во время выполнения в android studio - PullRequest
0 голосов
/ 29 апреля 2020

Извините за столько фотографий! Но у меня не было никакой другой идеи ясно выразить мой вопрос. enter image description here

Я должен сдвинуть текст в одном углу (вы можете видеть пустое пространство вокруг него), чтобы отобразить его в приложении нужного размера во время выполнения. Это показало изображение правильно, проблема была только с текстом. enter image description here Хотя я получил желаемый результат, но мне нужно сдвинуть текст в одном углу, чтобы отобразить его в приложении (как показано в представлении дизайна выше), в противном случае они обрезаются с размера экрана. Почему это происходит? ?

<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#625D42"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/textView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"

        android:background="#000000"
        android:text="Laurel Book Store"
        android:textAlignment="center"
        android:textAppearance="@style/TextAppearance.AppCompat.Large"
        android:textColor="#E1DFDF"
        android:textSize="30sp"
        android:textStyle="italic"
        android:visibility="visible"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="match_parent"
        android:layout_height="197dp"
        android:scaleType="centerCrop"
        android:src="@drawable/bookstore_hero"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="1.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView" />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="344dp"
        android:layout_height="216dp"
        android:layout_marginTop="22dp"
        android:text="Laurel Bookstore online is your place for Schools, Colleges textbooks, gear,comics,ancient books and supplies.Buy or rent used and new textbooks, find great quality in best price! We hope that you will enjoy your experience with us.
For more info regarding anything contact us at number given below or visit our store!We assure you will get full assistance from us!"
        android:textColor="#E1DFDF"
        android:textSize="20sp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.761"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/imageView" />

    <RelativeLayout
        android:layout_width="365dp"
        android:layout_height="65dp"
        android:layout_marginTop="22dp"
        android:background="#090E04"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@id/textView2">

        <TextView
            android:id="@+id/textView3"
            android:layout_width="match_parent"
            android:layout_height="20dp"
            android:layout_alignParentTop="true"
            android:layout_marginBottom="4dp"
            android:paddingLeft="8dp"
            android:text="Contact Us:+19 7728299929"
            android:textColor="#ABC393"
            android:textSize="16sp"
            app:layout_constraintBottom_toBottomOf="parent"
            tools:layout_editor_absoluteX="53dp" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/textView3"
            android:paddingLeft="8dp"
            android:text="Address: 26th street,near balcon colony,3rd dtreet,singapore"
            android:textColor="#ABC393"
            android:textSize="16dp" />
    </RelativeLayout>


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