Я сделал простой макет для моего калькулятора. В IDE это выглядит нормально, но на моем телефоне, Mate 8 это выглядит совершенно иначе - PullRequest
0 голосов
/ 13 мая 2018

Android-студия выглядит так, как я хочу, но на моем мате 8 выглядит иначе, чем на моем планшете

на моем планшете: как это выглядит на моем планшете

как это показывает на моем телефоне

ЭТО ОСНОВНАЯ ДЕЯТЕЛЬНОСТЬ:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout
        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:orientation="vertical"
        tools:context=".MainActivity">

 <TextView
            android:id="@+id/tv_userInput"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="1+2+3+4"
            android:textSize="30sp"
            android:textAlignment="textEnd"
            android:layout_gravity="end"
            android:layout_marginTop="2dp"

            />

<include
            layout="@layout/calc_buttons"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            />

    </LinearLayout>

ЭТО СЕТЕВОЕ РАСПОЛОЖЕНИЕ В ДРУГОЙ ДЕЯТЕЛЬНОСТИ:

<?xml version="1.0" encoding="utf-8"?>
<GridLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:columnCount="4"
    android:rowCount="5"
    android:layout_margin="2dp"

    >

    <!--1st line of buttons-->
    <Button
        android:id="@+id/btn_Clear"
        android:text="C"
        style="@style/FunctionalButtons"
        android:layout_column="0"
        android:layout_row="0"
        android:layout_columnWeight="1"
        android:layout_marginTop="2dp"
        android:layout_marginLeft="2dp"
        android:layout_marginRight="2dp"

        />
    <Button
        android:id="@+id/btn_Percentage"
        android:text="%"
        style="@style/FunctionalButtons"
        android:layout_column="1"
        android:layout_row="0"
        android:layout_columnWeight="1"
        android:layout_marginTop="2dp"
        android:layout_marginLeft="2dp"
        android:layout_marginRight="2dp"

        />
    <Button
        android:id="@+id/btn_Divide"
        android:text="/"
        style="@style/FunctionalButtons"
        android:layout_column="2"
        android:layout_row="0"
        android:layout_columnWeight="1"
        android:layout_marginTop="2dp"
        android:layout_marginLeft="2dp"
        android:layout_marginRight="2dp"
<!--2nd line of buttons-->
<!--3rd line of buttons -->

и т. Д.

 </GridLayout>

Я опустил большую часть повторяющегося кода, например кнопки для удобства чтения.

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