title: Android Studio xml object over object
body: <p>how can a put a TextView befor a Button in xml file? My textview always behind the button. I am in a constraintlayout. I want to make a little number in the top right corner of the button. I made a drawable for that, hat it looks nice.
  It would be nice if someone could help! Thanks!!!</p>
  
  <p>xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.constraintlayout.widget.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/MainLayout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="at.kessapps.cookieclicker.MainActivity"&gt;
  
      &lt;TextView
          android:id="@+id/clicker_discount"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:background="@drawable/sale_corner"
          android:text="20%"
          android:textStyle="bold"
          app:layout_constraintBottom_toTopOf="@+id/shopbutton"
          app:layout_constraintRight_toRightOf="@id/shopbutton"
          app:layout_constraintTop_toTopOf="@id/shopbutton" /&gt;
  
      &lt;ImageView
          android:id="@+id/imageView2"
          android:layout_width="350dp"
          android:layout_height="80dp"
          android:layout_marginTop="16dp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.508"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:srcCompat="@drawable/cooltext348859404219232" /&gt;
  
      &lt;Button
          android:id="@+id/shopbutton"
          style="@style/Widget.AppCompat.Button"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginEnd="16dp"
          android:layout_marginBottom="16dp"
          android:hapticFeedbackEnabled="false"
          android:onClick="toShop"
          android:text="Shop"
          android:drawableLeft="@drawable/ic_store"
          android:textColor="@color/colorWhite"
          android:paddingLeft="5dp"
          android:background="@drawable/button_neutral_background"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent" /&gt;
  
      &lt;ImageView
          android:id="@+id/onOption"
          android:layout_width="50dp"
          android:layout_height="50dp"
          android:layout_marginStart="16dp"
          android:layout_marginBottom="16dp"
          android:onClick="toOption"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:srcCompat="@drawable/optionen" /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/tLgDv.png" rel="nofollow noreferrer">here a picture</a></p>