Navigation bar appearing behind the scrollView

I’ve got a small issue, I’m learning to use Android with Java programming language. So far I’ve managed to add a scroll system, some pictures and a slideshow of images. I’m trying to add a navigation bar at the bottom however I think it is appearing behind the scrollView. I’m not sure if I’ve coded it wrong or it has to be in a specific order, some advice would be appreciated. I’ve also noticed my Constraint Widget disappeared for bottomNavigationView.

activity_main.xml

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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"
tools:context=".MainActivity">
<FrameLayout
android:layout_width="0sp"
android:layout_height="0sp"
app:layout_constraintBottom_toTopOf="@+id/bottomNavigationView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
</FrameLayout>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottomNavigationView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:menu="@menu/bottom_nav_menu" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.denzcoskun.imageslider.ImageSlider
android:id="@+id/image_slider"
android:layout_width="wrap_content"
android:layout_height="300dp"
app:iss_auto_cycle="true"
app:iss_delay="1000"
app:iss_period="1000"
app:iss_text_align="CENTER" />
<!-- Title -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingBottom="16dp"
android:text="Museums and Culture of Wales"
android:textSize="24sp"
android:textStyle="bold" />
<!-- National Museum Cardiff -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="4dp"
android:text="1. National Museum Cardiff: Located in the capital city, this museum houses an incredible collection of art, archaeology, and natural history. It’s a must-visit for anyone interested in exploring the artistic and scientific achievements of Wales."
android:textSize="16sp" />
<ImageView
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:scaleType="centerCrop"
android:src="@drawable/img1" />
<!-- St Fagans National Museum of History -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="4dp"
android:text="2. St Fagans National Museum of History: A unique open-air museum near Cardiff that features over forty original buildings from different historical periods in Welsh history. It provides a vivid picture of life in Wales over centuries."
android:textSize="16sp" />
<ImageView
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:scaleType="centerCrop"
android:src="@drawable/img2" />
<!-- Big Pit National Coal Museum -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="4dp"
android:text="3. Big Pit National Coal Museum: This UNESCO World Heritage Site in Blaenavon lets you explore the life of coal miners with a guided underground tour. It’s a fascinating way to learn about Wales' industrial heritage."
android:textSize="16sp" />
<ImageView
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:scaleType="centerCrop"
android:src="@drawable/img3" />
<!-- Pontcysyllte Aqueduct -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="4dp"
android:text="4. Pontcysyllte Aqueduct: Not a museum but a cultural icon, this aqueduct is a masterpiece of engineering and a UNESCO World Heritage Site. It’s a testament to Wales’ contributions to industrial innovation."
android:textSize="16sp" />
<ImageView
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:scaleType="centerCrop"
android:src="@drawable/img4" />
<!-- Closing Paragraph -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="4dp"
android:text="Wales is also celebrated for its music, language, and festivals. The Eisteddfod, an annual cultural festival, showcases the best in Welsh poetry, music, and art, while the Welsh language (Cymraeg) remains an integral part of the country's identity. Whether you’re visiting its museums or experiencing its vibrant culture firsthand, Wales offers an unforgettable journey into the past and present."
android:textSize="16sp" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
</code>
<code><?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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" tools:context=".MainActivity"> <FrameLayout android:layout_width="0sp" android:layout_height="0sp" app:layout_constraintBottom_toTopOf="@+id/bottomNavigationView" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> </FrameLayout> <com.google.android.material.bottomnavigation.BottomNavigationView android:id="@+id/bottomNavigationView" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="visible" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:menu="@menu/bottom_nav_menu" /> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:padding="16dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <com.denzcoskun.imageslider.ImageSlider android:id="@+id/image_slider" android:layout_width="wrap_content" android:layout_height="300dp" app:iss_auto_cycle="true" app:iss_delay="1000" app:iss_period="1000" app:iss_text_align="CENTER" /> <!-- Title --> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:paddingBottom="16dp" android:text="Museums and Culture of Wales" android:textSize="24sp" android:textStyle="bold" /> <!-- National Museum Cardiff --> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:lineSpacingExtra="4dp" android:text="1. National Museum Cardiff: Located in the capital city, this museum houses an incredible collection of art, archaeology, and natural history. It’s a must-visit for anyone interested in exploring the artistic and scientific achievements of Wales." android:textSize="16sp" /> <ImageView android:layout_width="match_parent" android:layout_height="200dp" android:layout_marginTop="8dp" android:layout_marginBottom="16dp" android:scaleType="centerCrop" android:src="@drawable/img1" /> <!-- St Fagans National Museum of History --> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:lineSpacingExtra="4dp" android:text="2. St Fagans National Museum of History: A unique open-air museum near Cardiff that features over forty original buildings from different historical periods in Welsh history. It provides a vivid picture of life in Wales over centuries." android:textSize="16sp" /> <ImageView android:layout_width="match_parent" android:layout_height="200dp" android:layout_marginTop="8dp" android:layout_marginBottom="16dp" android:scaleType="centerCrop" android:src="@drawable/img2" /> <!-- Big Pit National Coal Museum --> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:lineSpacingExtra="4dp" android:text="3. Big Pit National Coal Museum: This UNESCO World Heritage Site in Blaenavon lets you explore the life of coal miners with a guided underground tour. It’s a fascinating way to learn about Wales' industrial heritage." android:textSize="16sp" /> <ImageView android:layout_width="match_parent" android:layout_height="200dp" android:layout_marginTop="8dp" android:layout_marginBottom="16dp" android:scaleType="centerCrop" android:src="@drawable/img3" /> <!-- Pontcysyllte Aqueduct --> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:lineSpacingExtra="4dp" android:text="4. Pontcysyllte Aqueduct: Not a museum but a cultural icon, this aqueduct is a masterpiece of engineering and a UNESCO World Heritage Site. It’s a testament to Wales’ contributions to industrial innovation." android:textSize="16sp" /> <ImageView android:layout_width="match_parent" android:layout_height="200dp" android:layout_marginTop="8dp" android:layout_marginBottom="16dp" android:scaleType="centerCrop" android:src="@drawable/img4" /> <!-- Closing Paragraph --> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:lineSpacingExtra="4dp" android:text="Wales is also celebrated for its music, language, and festivals. The Eisteddfod, an annual cultural festival, showcases the best in Welsh poetry, music, and art, while the Welsh language (Cymraeg) remains an integral part of the country's identity. Whether you’re visiting its museums or experiencing its vibrant culture firsthand, Wales offers an unforgettable journey into the past and present." android:textSize="16sp" /> </LinearLayout> </ScrollView> </RelativeLayout> </code>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    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"
    tools:context=".MainActivity">

    <FrameLayout
        android:layout_width="0sp"
        android:layout_height="0sp"
        app:layout_constraintBottom_toTopOf="@+id/bottomNavigationView"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">
    </FrameLayout>

    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottomNavigationView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:visibility="visible"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:menu="@menu/bottom_nav_menu" />

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="16dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">


            <com.denzcoskun.imageslider.ImageSlider
                android:id="@+id/image_slider"
                android:layout_width="wrap_content"
                android:layout_height="300dp"
                app:iss_auto_cycle="true"
                app:iss_delay="1000"
                app:iss_period="1000"
                app:iss_text_align="CENTER" />

            <!-- Title -->
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:paddingBottom="16dp"
                android:text="Museums and Culture of Wales"
                android:textSize="24sp"
                android:textStyle="bold" />

            <!-- National Museum Cardiff -->
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:lineSpacingExtra="4dp"
                android:text="1. National Museum Cardiff: Located in the capital city, this museum houses an incredible collection of art, archaeology, and natural history. It’s a must-visit for anyone interested in exploring the artistic and scientific achievements of Wales."
                android:textSize="16sp" />

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="200dp"
                android:layout_marginTop="8dp"
                android:layout_marginBottom="16dp"
                android:scaleType="centerCrop"
                android:src="@drawable/img1" />

            <!-- St Fagans National Museum of History -->
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:lineSpacingExtra="4dp"
                android:text="2. St Fagans National Museum of History: A unique open-air museum near Cardiff that features over forty original buildings from different historical periods in Welsh history. It provides a vivid picture of life in Wales over centuries."
                android:textSize="16sp" />

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="200dp"
                android:layout_marginTop="8dp"
                android:layout_marginBottom="16dp"
                android:scaleType="centerCrop"
                android:src="@drawable/img2" />

            <!-- Big Pit National Coal Museum -->
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:lineSpacingExtra="4dp"
                android:text="3. Big Pit National Coal Museum: This UNESCO World Heritage Site in Blaenavon lets you explore the life of coal miners with a guided underground tour. It’s a fascinating way to learn about Wales' industrial heritage."
                android:textSize="16sp" />

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="200dp"
                android:layout_marginTop="8dp"
                android:layout_marginBottom="16dp"
                android:scaleType="centerCrop"
                android:src="@drawable/img3" />

            <!-- Pontcysyllte Aqueduct -->
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:lineSpacingExtra="4dp"
                android:text="4. Pontcysyllte Aqueduct: Not a museum but a cultural icon, this aqueduct is a masterpiece of engineering and a UNESCO World Heritage Site. It’s a testament to Wales’ contributions to industrial innovation."
                android:textSize="16sp" />

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="200dp"
                android:layout_marginTop="8dp"
                android:layout_marginBottom="16dp"
                android:scaleType="centerCrop"
                android:src="@drawable/img4" />

            <!-- Closing Paragraph -->
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:lineSpacingExtra="4dp"
                android:text="Wales is also celebrated for its music, language, and festivals. The Eisteddfod, an annual cultural festival, showcases the best in Welsh poetry, music, and art, while the Welsh language (Cymraeg) remains an integral part of the country's identity. Whether you’re visiting its museums or experiencing its vibrant culture firsthand, Wales offers an unforgettable journey into the past and present."
                android:textSize="16sp" />

        </LinearLayout>
    </ScrollView>
</RelativeLayout>

bottom_nav_menu.xml

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/home"
android:title="Home"
app:actionProviderClass="androidx.mediarouter.app.MediaRouteActionProvider"
tools:icon="@drawable/ic_home" />
<item
android:id="@+id/maps"
android:title="Maps"
app:actionProviderClass="androidx.mediarouter.app.MediaRouteActionProvider"
tools:icon="@drawable/ic_maps" />
<item
android:id="@+id/details"
android:title="Details"
app:actionProviderClass="androidx.mediarouter.app.MediaRouteActionProvider"
tools:icon="@drawable/ic_detail" />
<item
android:id="@+id/settings"
android:title="Settings"
app:actionProviderClass="androidx.mediarouter.app.MediaRouteActionProvider"
tools:icon="@drawable/ic_setting" />
</menu>
</code>
<code> <?xml version="1.0" encoding="utf-8"?> <menu xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/home" android:title="Home" app:actionProviderClass="androidx.mediarouter.app.MediaRouteActionProvider" tools:icon="@drawable/ic_home" /> <item android:id="@+id/maps" android:title="Maps" app:actionProviderClass="androidx.mediarouter.app.MediaRouteActionProvider" tools:icon="@drawable/ic_maps" /> <item android:id="@+id/details" android:title="Details" app:actionProviderClass="androidx.mediarouter.app.MediaRouteActionProvider" tools:icon="@drawable/ic_detail" /> <item android:id="@+id/settings" android:title="Settings" app:actionProviderClass="androidx.mediarouter.app.MediaRouteActionProvider" tools:icon="@drawable/ic_setting" /> </menu> </code>
    <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:id="@+id/home"
        android:title="Home"
        app:actionProviderClass="androidx.mediarouter.app.MediaRouteActionProvider"
        tools:icon="@drawable/ic_home" />
    <item
        android:id="@+id/maps"
        android:title="Maps"
        app:actionProviderClass="androidx.mediarouter.app.MediaRouteActionProvider"
        tools:icon="@drawable/ic_maps" />
    <item
        android:id="@+id/details"
        android:title="Details"
        app:actionProviderClass="androidx.mediarouter.app.MediaRouteActionProvider"
        tools:icon="@drawable/ic_detail" />
    <item
        android:id="@+id/settings"
        android:title="Settings"
        app:actionProviderClass="androidx.mediarouter.app.MediaRouteActionProvider"
        tools:icon="@drawable/ic_setting" />
</menu>

3

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật