4
I’m in trouble that I do not think how to solve, I have an Activity as in the photo below, the problem is, that when I emulate the application, the Button and the textView go down the two colored Linearlayouts (blue and green).
I would like to know how to assign a property to Button and textView, so that they are above the Layouts
Note: I didn’t want to put the Button and the textView inside the colored Layouts.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.uriel.aaa.MainActivity">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#00008B"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#008B45"/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="@dimen/activity_vertical_margin"
android:text="aaa"
android:textColor="#FFFFFF"
android:textSize="40sp"
android:gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:id="@+id/textView"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Testar"
android:textSize="40sp"
android:id="@+id/buttonStart"
android:background="#FFFFFF"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true" />
</RelativeLayout>
Can share layout XML?
– Mateus
Talks Uriel, tries to put the Buttons after the layouts in XML, but as Professor Matthew said, you better send XML, Hugs.
– Leonardo Dias
oops, I put it there, I forgot, sorry
– Uriel Kindermann
the main layout of Activity is Framelayout?
– Marco Giovanni
Did you put all the xml layout in the question? There is no Groupview that is "root" or "parent of all" as a Relativelayout, Linearlayout or Framelayout?
– Tássio Auad
This is inside a relativeLayout, but when I copied and pasted did not appear sorry, on the print to see there in the tree
– Uriel Kindermann
You could post the Activity Java code for this layout?
– Vitor Henrique
@Urielkindermann, I ran here and it normally appeared Textview and Button above the layout. Could you put the Activity code so we can try to figure out what’s going on?
– Tássio Auad