Answer the question
In order to leave comments, you need to log in
How to make one element in ScrollView without scrolling down?
I have a ScrollView, I want to add an advertising LiearLayout at the bottom of the screen so that it does not scroll down with all the elements, how to do this?
Here is my activity
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
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:orientation="vertical"
tools:context=".MainActivity"
android:layout_below="@+id/ads_line"
android:background="@color/blue_dark">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:fontFamily="@font/poppinsbold"
android:gravity="center"
android:text="@string/app_title"
android:textColor="@color/white"
android:textSize="25sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/poppinsmedium"
android:gravity="center"
android:layout_marginHorizontal="8dp"
android:text="@string/description"
android:textColor="@color/white"
android:textSize="15sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title" />
<Button
android:id="@+id/one"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/blue_light"
android:text="Bitcoin"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/description" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question