1
I’m developing an application and I put an image with a text underneath but when I run the application it looks like, the text next to the image:
<?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"
android:background="@android:color/holo_blue_light"
tools:context="com.example.tulio.myapplication.MainActivity">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView2"
tools:layout_editor_absoluteY="280dp">
<TextView
android:id="@+id/textView2"
android:layout_width="368dp"
android:layout_height="wrap_content"
android:text="@string/alan"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="297dp" />
</ScrollView>
<TextView
android:id="@+id/txtNome1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoText="false"
android:text="Alan Turing"
android:textColor="?android:attr/colorActivatedHighlight"
tools:layout_editor_absoluteX="161dp"
tools:layout_editor_absoluteY="16dp" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/alan"
tools:layout_editor_absoluteX="106dp"
tools:layout_editor_absoluteY="41dp" />
(Color.parseColor("#BABABA")); />
</android.support.constraint.ConstraintLayout>
How was the application
by placing all the content inside the Scrollview it error, and the image comes out
– User1999
This layout is not clear to me. 1º I do not understand why two Widgets are out of Scrollview which is Parent Widget, 2º Put all components in a Linearlayout and set the orientation as vertical
– lima_t
Opa, puts the image inside a linear_layout and the text inside another linear_layout (this below the image layout), then just set the wrap and match Parent.
– Rhadamez Gindri Hercilio
thanks for the personal tip
– User1999