Here is the full XML android layout file code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content" >
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="New Button"
android:textAllCaps="false"
android:textSize="15pt"
android:id="@+id/element_button"
android:layout_gravity="center" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/element_number"
android:layout_gravity="top|left" />
</FrameLayout>
It produces this in the android Studio preview window as well as on the device:
Am I losing it? What gives? As you can see, the "New Text" text view is BEHIND the button. When in every code sample I found on stackoverflow, and in simple programming logic, the button gets drawn FIRST, THEN the TextView, therefore, textview is on top of button. But its not. This happens with the RelativeLayout as well.