Blocked components, piled up on the left - Android Studio

1

When adding components to the design, they appear stacked in a pixel in the upper left corner and can not be moved or resized. I already tried several ways to fix it that they suggested in other publications and reinstalling after deleting the folder "C: \ Users .... AndroidStudio3.1" but it did not work. Any ideas? Thanks.

<?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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Hello World!"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

In the .xml mark me this: xmlns: app="http://schemas.android.com/apk/res-auto" is not being used.

    
asked by N.N. 03.07.2018 в 14:03
source

1 answer

1

In the constraint layout, if you do not create chains to the elements, what happens to you happens, that they all pile up in the upper left corner, what you have to do every time you create a new element in the layout is to drag the points that you see on the four sides of the element, you can drag them to another element or to the edge of the layout. Because the counterint layout works that way, by chains, and you need to indicate where the elemnto chains go.

If Android Studio notifies you of an error related to the ActionBar this answer can help you: Android Studio preview error

    
answered by 03.07.2018 / 14:42
source