【发布时间】:2015-01-22 08:33:26
【问题描述】:
我希望在我的活动中向工具栏添加几个 EditText,并根据 Material 设计规范增加其高度,如下图所示:
我如何实现这一点,即如何将普通小部件添加到工具栏并增加它的高度?
谢谢!
【问题讨论】:
标签: android material-design android-toolbar
我希望在我的活动中向工具栏添加几个 EditText,并根据 Material 设计规范增加其高度,如下图所示:
我如何实现这一点,即如何将普通小部件添加到工具栏并增加它的高度?
谢谢!
【问题讨论】:
标签: android material-design android-toolbar
你不会相信,但它是如此简单:
<?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>
【讨论】: