Android ConstraintLayout generiert absolute Werte

Ich habe vor kurzem angefangen zu lernen, das neue ConstraintLayout in Android Studio 2.2 und bemerkt, dass wenn ich hinzufügen einfachste von der Aussicht, im layout-editor erzeugt automatisch einige absolute Koordinaten. Hier ist eine Beispiel-XML:

<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_portfolio"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.abc.Activity"
    tools:layout_editor_absoluteX="0dp"
    tools:layout_editor_absoluteY="81dp">

    <TextView
        android:text="@string/creator_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        tools:layout_editor_absoluteX="246dp"
        tools:layout_editor_absoluteY="479dp"
        android:id="@+id/first_textview"
        app:layout_constraintRight_toRightOf="@+id/activity"
        android:layout_marginEnd="16dp"
        tools:layout_constraintRight_creator="0"
        app:layout_constraintBottom_toBottomOf="@+id/activity"
        android:layout_marginBottom="16dp"
        tools:layout_constraintBottom_creator="0" />
</android.support.constraint.ConstraintLayout>

Beachten Sie das absolute wie 81dp, 246dp, 479dp... ich habe versucht, manuell zu löschen, aber wenn ich zurück auf den tab "Design" und kommen zurück auf die "Text" - Registerkarte, diese zu regenerieren. Nun, ich habe drei Fragen:

  1. Gibt es eine Möglichkeit zu sagen, Android Studio nicht generieren diese?
  2. Sollte ich manuell legen Sie Sie in dimens.xml?
  3. Würde diese absolute Ursache einige layout-Probleme in anderen Geräten?

InformationsquelleAutor der Frage Ankur Aggarwal | 2016-05-29

Schreibe einen Kommentar