Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/363.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
Java 安卓4.4上的材料_Java_Android_Material Design - Fatal编程技术网

Java 安卓4.4上的材料

Java 安卓4.4上的材料,java,android,material-design,Java,Android,Material Design,我正在用安卓Studio 2.3.3开发我的应用程序,任何元素都在安卓7的材质设计中,但如果在安卓4.4上运行应用程序,元素的位置和样式都会发生变化 运行7.1.1 在4.4上运行 我知道安卓4不支持材料设计,第三方物品除外,但我想了解为什么位置会发生变化 有什么想法或解决办法吗 <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:and

我正在用安卓Studio 2.3.3开发我的应用程序,任何元素都在安卓7的材质设计中,但如果在安卓4.4上运行应用程序,元素的位置和样式都会发生变化

运行7.1.1

在4.4上运行

我知道安卓4不支持材料设计,第三方物品除外,但我想了解为什么位置会发生变化

有什么想法或解决办法吗

<?xml version="1.0" encoding="utf-8"?>
    <android.support.constraint.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:id="@+id/activity_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal"
        android:gravity="center"
        tools:context="com.scannerproject.MainActivity"
        android:layout_weight="1"
        tools:layout_editor_absoluteY="0dp"
        tools:layout_editor_absoluteX="0dp">

 <Button
        android:id="@+id/button"
        android:layout_width="243dp"
        android:layout_height="47dp"
        android:background="@color/colorPrimary"
        android:onClick="scan"
        android:text="SCANSIONE"
        android:textColor="#fff"
        android:layout_marginStart="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        app:layout_constraintLeft_toLeftOf="parent"
        android:layout_marginRight="8dp"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_marginTop="8dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintHorizontal_bias="0.504"
        android:layout_marginBottom="8dp"
        app:layout_constraintVertical_bias="0.457" />    

    <Switch
            android:id="@+id/flash"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Attiva Flash"
            android:layout_marginRight="8dp"
            app:layout_constraintRight_toRightOf="@+id/button"
            android:layout_marginLeft="8dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintHorizontal_bias="1.0"
            app:layout_constraintTop_toTopOf="parent"
            android:layout_marginTop="8dp"
            app:layout_constraintBottom_toBottomOf="parent"
            android:layout_marginBottom="8dp"
            app:layout_constraintVertical_bias="0.555" />

    </android.support.constraint.ConstraintLayout>

小补丁,用右键指向右开关


请提供您正在使用的代码。