Просмотры не отображаются в эмуляторе Android - PullRequest
0 голосов
/ 18 июня 2019

Я пытаюсь создать простое приложение, но столкнулся со следующей проблемой. Все мои взгляды появились в предварительном просмотре при проектировании. Однако, когда я запускаю приложение через свое физическое устройство, некоторые виды исчезают. Я использую физическое устройство с обновлением Android версии 8.1.0, поскольку процессор моего компьютера - AMD ryzen. Я не могу использовать эмулятор Android Studio, целевой SDK - 26.

обратите внимание, что все это произошло, когда я обновил android studio до версии 3.5 canary

Я пытался изменить SDK, но получил некоторые ошибки.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
tools:context=".GPA_4_1">

<LinearLayout
    android:id="@+id/FirstCourse"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="40dp"
    android:orientation="horizontal">

    <TextView
        android:id="@+id/Result_4_1"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </TextView>

    <Spinner
        android:id="@+id/spinner_4_1"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </Spinner>

    <EditText
        android:id="@+id/CreditHour_1"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:inputType="number"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </EditText>


</LinearLayout>

<LinearLayout
    android:id="@+id/SecondCourse"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/FirstCourse"
    android:layout_marginTop="20dp"
    android:orientation="horizontal">

    <TextView
        android:id="@+id/Result_4_2"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </TextView>

    <Spinner
        android:id="@+id/spinner_4_2"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </Spinner>

    <EditText
        android:id="@+id/CreditHour_2"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:inputType="number"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </EditText>


</LinearLayout>

<LinearLayout
    android:id="@+id/ThirdCourse"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/SecondCourse"
    android:layout_marginTop="20dp"
    android:orientation="horizontal">

    <TextView
        android:id="@+id/Result_4_3"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </TextView>

    <Spinner
        android:id="@+id/spinner_4_3"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </Spinner>

    <EditText
        android:id="@+id/CreditHour_3"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:inputType="number"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </EditText>


</LinearLayout>

<LinearLayout
    android:id="@+id/ForthCourse"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/ThirdCourse"
    android:layout_marginTop="20dp"
    android:orientation="horizontal">

    <TextView
        android:id="@+id/Result_4_4"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </TextView>

    <Spinner
        android:id="@+id/spinner_4_4"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </Spinner>

    <EditText
        android:id="@+id/CreditHour_4"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:inputType="number"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </EditText>


</LinearLayout>

<LinearLayout
    android:id="@+id/FifthCourse"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/ForthCourse"
    android:layout_marginTop="20dp"
    android:orientation="horizontal">

    <TextView
        android:id="@+id/Result_4_5"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </TextView>

    <Spinner
        android:id="@+id/spinner_4_5"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </Spinner>

    <EditText
        android:id="@+id/CreditHour_5"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:inputType="number"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </EditText>

</LinearLayout>


<LinearLayout
    android:id="@+id/SixthCourse"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/FifthCourse"
    android:layout_marginTop="20dp"
    android:orientation="horizontal">

    <TextView
        android:id="@+id/Result_4_6"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </TextView>

    <Spinner
        android:id="@+id/spinner_4_6"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </Spinner>

    <EditText
        android:id="@+id/CreditHour_6"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:inputType="number"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </EditText>


</LinearLayout>

<LinearLayout
    android:id="@+id/SeventhCourse"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/SixthCourse"
    android:layout_marginTop="20dp"
    android:orientation="horizontal">

    <TextView
        android:id="@+id/Result_4_7"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </TextView>

    <Spinner
        android:id="@+id/spinner_4_7"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </Spinner>

    <EditText
        android:id="@+id/CreditHour_7"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:inputType="number"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </EditText>


</LinearLayout>

<LinearLayout
    android:id="@+id/EighthCourse"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/SeventhCourse"
    android:layout_marginTop="20dp"
    android:orientation="horizontal">

    <TextView
        android:id="@+id/Result_4_8"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </TextView>

    <Spinner
        android:id="@+id/spinner_4_8"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </Spinner>

    <EditText
        android:id="@+id/CreditHour_8"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:inputType="number"
        android:paddingLeft="5dp"
        android:paddingRight="5dp">

    </EditText>


</LinearLayout>


<TextView
    android:id="@+id/Result"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/EighthCourse"
    android:layout_marginTop="20dp"
    android:layout_marginBottom="20dp">

</TextView>

<Button
    android:id="@+id/Calculate"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/Result">

</Button>

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...