Creating bottom horizontal menu Android Studio

Asked

Viewed 1,341 times

0

I want to create a navigation bottom in my application. I took a look at what’s in the Android documentation, but I wish the icons weren’t highlighted in size when clicked, like Youtube.

Could you help me?

  • Are you looking for something like this? https://material.io/guidelines/components/bottom-navigation.html#

1 answer

0


Behold in that reply how creating tabs, and to fix the TabLayout in the footer, insert a ViewPager previously defined the property layout_weight as 1. See how it should look:

<LinearLayout 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=".MainTest"
    android:orientation="vertical">

    <android.support.v7.widget.Toolbar 
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        android:minHeight="?attr/actionBarSize"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
        app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />

    <android.support.v4.view.ViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"/>

    <android.support.design.widget.TabLayout
        android:id="@+id/sliding_tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        />    
</LinearLayout>

See an image below:

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.