Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 像谷歌地图应用程序一样垂直扩展工具栏_Android_Xml_Android Layout_Material Design_Android Toolbar - Fatal编程技术网

Android 像谷歌地图应用程序一样垂直扩展工具栏

Android 像谷歌地图应用程序一样垂直扩展工具栏,android,xml,android-layout,material-design,android-toolbar,Android,Xml,Android Layout,Material Design,Android Toolbar,我的目标是垂直扩展并添加类似的信息,如图所示(具体来说,我指的是带有汽车、电车、步行和自行车图标和时间的最后一行): 我使用了LinearLayout在工具栏的xml文件中添加了一些内容,实际上,我已经成功地创建了一个带有TextView的“行”和一个带有按钮的“行”(如果需要查看屏幕截图,请告诉我): 请考虑这个扩展的工具栏只在某些活动中扩展,它不会永久地这样。大多数视图将以简单的形式使用它,即仅应用程序标题和右侧的菜单(在我的设计中尚未添加) 我是走对了还是错过了什么?有没有其他推荐的

我的目标是垂直扩展并添加类似的信息,如图所示(具体来说,我指的是带有汽车电车步行自行车图标和时间的最后一行):

我使用了
LinearLayout
在工具栏的xml文件中添加了一些内容,实际上,我已经成功地创建了一个带有
TextView
的“行”和一个带有
按钮的“行”(如果需要查看屏幕截图,请告诉我):


请考虑这个扩展的工具栏只在某些活动中扩展,它不会永久地这样。大多数视图将以简单的形式使用它,即仅应用程序标题和右侧的菜单(在我的设计中尚未添加)

我是走对了还是错过了什么?有没有其他推荐的方法可以获得相同的结果?谷歌就是这样实现的吗?

请看这篇文章: 特别是问题中的链接。您希望使用汽车、自行车等选项卡的表格布局和扩展工具栏。这两个都在blogpost中有描述。

你指的是正在折叠的工具栏,但是的,就是它!其他人提到这是一个评论,但你已经发布了一个答案,所以我会接受这个。
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#CCC">
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="48dp"
            android:text="Application Title"/>
        <Button
            android:layout_width="128dp"
            android:layout_height="48dp"
            android:text="A button"/>
    </LinearLayout>
</android.support.v7.widget.Toolbar>