How to add widgets to toolbar and increase its height

I am looking to add a couple of EditTexts to the toolbar in my activity as well as increase its height according to the Material design specs something like the image below :

How do I achieve this i.e. how do I add normal widgets to the toolbar and increase it height ?

Thanks !

Answers


You won't believe but its so simple:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="250dp"            // Height of toolbar 
android:background="@color/anycolor">

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint=""/>

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint=""/>   

//Add as many widgets as you want

</android.support.v7.widget.Toolbar>

Need Your Help

What are cons to use % over em in terms of accessibility?

html css xhtml accessibility

What are cons to use % over em in terms of accessibility?

Controlling iOS UITableView

ios uitableview nsarraycontroller

I've some experiences with creating an OS X app handling multiple user input with an array controller. The NSArrayController takes care of showing and updating an NSTableViews content. Adding, edi...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.