Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/193.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
Android 我怎样才能设置一个";布局图“左/右边缘”;从约束布局编辑器?_Android_Android Layout_Android Studio_Android Layout Editor - Fatal编程技术网

Android 我怎样才能设置一个";布局图“左/右边缘”;从约束布局编辑器?

Android 我怎样才能设置一个";布局图“左/右边缘”;从约束布局编辑器?,android,android-layout,android-studio,android-layout-editor,Android,Android Layout,Android Studio,Android Layout Editor,我有一个minSdk=15的应用程序 我正在尝试迁移到ConstraintLayout 差不多可以。但是,当我从布局编辑器更改左边距的值时,将删除布局左边距/右边距属性 之前 <TextView android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginLeft="24dp" android:layout_

我有一个minSdk=15的应用程序

我正在尝试迁移到ConstraintLayout

差不多可以。但是,当我从布局编辑器更改左边距的值时,将删除布局左边距/右边距属性

之前

    <TextView
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="24dp" 
        android:layout_marginStart="24dp" // <- I will set to 16dp from layout editor
    />

我不知道你是如何改变它的,但在我的情况下,它不会发生

第二件事是,这就是为什么要设置左和右。您应该使用start和end

仍然要设置左右边距,可以通过单击“查看所有属性”从“属性”选项卡进行设置


你可以像下面那样添加它

o

单击“工具”(指定设计特性)按钮,然后可以添加它

就像我在左边距做的一样


一个缓存是,它仅用于设计透视图。它将添加工具:layout\u margineLeft非android:layout\u margineLeft,您需要它

在api级别16中,layout\u margineLeft\u开始/结束不受支持。所以我想把布局设置为左/右。在布局编辑器的“查看所有属性”中的*layout\u marginLeft/Right,总是拒绝我的设置值。@kyanro ConstraintLayout去年才出现,所以对于api级别16,如果我没有错的话,他们已经在layout\u margin\u start/end中支持了。在我的api级别16模拟器中,它被android:layout\u marginStart/end属性忽略。它在真实设备中工作吗?我需要安卓:layout_marginLeft/右。非工具:布局\边缘左/右。
<TextView
    android:layout_width="0dp"
    android:layout_height="wrap_content"
                                      // <- layout_marginLeft is removed...
    android:layout_marginStart="16dp" // <- it is ok
    />