Best Way To Create A Bottom Toolbar In Android.
Solution 1:
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/actionbarT"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/thebackgroundimageyouwant"
android:minHeight="?attr/actionBarSize"
app:theme="@style/Base.Theme.AppCompat.CompactMenu" >
<LinearLayout
android:id="@+id/toolbarmenucontainer"
android:layout_width="match_parent"
android:weightSum="3"
android:layout_height="match_parent"
android:orientation="horizontal" >
<ImageButton
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@drawable/preferedbackground"
android:clickable="true"
android:scaleType="fitXY"
android:layout_weight = "1"
android:src="@drawable/preferredimage" />
<ImageButton
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@drawable/preferedbackground"
android:clickable="true"
android:scaleType="fitXY"
android:layout_weight = "1"
android:src="@drawable/preferredimage" />
<ImageButton
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="@drawable/preferedbackground"
android:clickable="true"
android:scaleType="fitXY"
android:layout_weight = "1"
android:src="@drawable/preferredimage" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
the idea is they will lay out horizontally like the one you want, also then do not do ToolBar.setTitle()
or setnagivation on the ToolBar
also you don't have to add optionsMenu to it. so it will be bare like the one you want.
try it and see if it fits your requirement, remember to add the background and image src to the ImageButton
s
Solution 2:
I know this question is super old, but I figure it's never too late to answer for other peoples sake who are searching for the same thing. I just found this tutorial and these official docs on the subject now that bottom navs are officially supported by Android and are a part of the material design guidelines if your app has 3 to 5 top level navigation locations. I hope this helps someone else, because I spent a good bit of time looking around for this.
Solution 3:
I shared my solution on GitHub. It is for Xamarin but the layouts are the same.
Solution 4:
I came to this question sometime back. I was unable to add text below the buttons. I have written an article how I solved the problem with code snippet and screenshot here, create goolge plus like toolbar in android
Solution 5:
This works for me in 2020, Android Studio 3.5.3 is how to set a Toolbar (the second half of the accepted answer). How do I align views at the bottom of the screen? You can use a Toolbar layout/widget in androidx.appcompat.widget.Toolbar
Set the alignParentBottom property to "true" (Place the elements Inside a RelativeLayout).
Post a Comment for "Best Way To Create A Bottom Toolbar In Android."