I am creating simple Android application where user can read lyrics while listening song.
My problem is in inside android activity.
After ScrollView there are 3 imageViews inside linearLayout these are my play,pause and stop images which are not showing
what am i doing wrong?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="#DFC3C3"
tools:context=".FirstSong"
android:orientation="vertical">
<TextView
android:id="@+id/textView4"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="13dp"
android:background="@drawable/ic_button_brown_pink"
android:gravity="center"
android:text="@string/firstSongTitle"
android:textColor="#26358A"
android:textSize="28sp"
android:textStyle="bold"
/>
<ScrollView
android:id="@+id/scrollView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="300dp"
android:orientation="vertical">
<TextView
android:id="@+id/txtTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="36dp"
android:gravity="center"
android:text=""
android:textAlignment="center"
android:textColor="#094F59"
android:textSize="17sp"
android:textStyle="bold" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageplay"
android:layout_width="61dp"
android:layout_height="34dp"
app:srcCompat="@drawable/ic_green1playbutton"
tools:layout_editor_absoluteX="102dp"
tools:layout_editor_absoluteY="651dp" />
<ImageView
android:id="@+id/imagepause"
android:layout_width="61dp"
android:layout_height="34dp"
app:srcCompat="@drawable/ic_green1pausebutton"
tools:layout_editor_absoluteX="173dp"
tools:layout_editor_absoluteY="651dp" />
<ImageView
android:id="@+id/imagestop"
android:layout_width="61dp"
android:layout_height="34dp"
app:srcCompat="@drawable/ic_green1stopbutton"
tools:layout_editor_absoluteX="234dp"
tools:layout_editor_absoluteY="651dp" />
</LinearLayout>
</LinearLayout>
By the way i’am new to Android Studio
2
Answers
How big is your scroll view? The way you wrote it, the scroll view’s height will be min(scroll view content size, remainder of screen). If you want to assure those buttons are shown, use a ConstraintLayout or RelativeLayout. Have the LinearLayout with the buttons align to the bottom of the screen, and constrain the scroll view to be above it.
make scroll view height 300dp and linear layout which is below scroll view wrap content