【问题标题】:Creating an actionbar or toolbar with custom xml and a drawertoggle使用自定义 xml 和抽屉切换创建操作栏或工具栏
【发布时间】:2015-07-01 16:15:44
【问题描述】:

如何创建一个工具栏/操作栏,将默认的actiondrawertoggle 按钮(带有汉堡箭头动画) 与edittext 和这样的简单按钮相结合?

【问题讨论】:

  • 什么是“汉堡箭头动画”?
  • 当你打开抽屉时,左键会变成一个箭头

标签: android toolbar drawertoggle


【解决方案1】:

ToolbarViewGroup,因此,您可以将Toolbar 用作FrameLayout

这里是一个简单的例子,看一下:

<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/toolbar_appcompat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" >
    <LinearLayout 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >
    //customize your toolbar content layout here.
    </LinearLayout >
</android.support.v7.widget.Toolbar>

希望你会受到启发。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多