是否可以制作一个 Google 照片风格的搜索栏?
Is it possible to make a Google Photos style search bar?
在Google相册中,工具栏实际上是一个搜索栏,既有抽屉的图标,又有搜索图标,还有搜索栏的功能。有什么方法可以在我自己的应用程序中重新创建它而不是使用标准工具栏?如果需要,我可以提供屏幕截图。
Google 使用 "Material Design" (https://material.google.com/) 概念,因此搜索 "Material Design".
如果您有一个网络项目,请考虑 https://getmdl.io/ or https://material.angularjs.org 例如。
您需要使用应用栏布局并添加编辑文本。如果您希望工具栏看起来像浮动的,请指定 margin xml 属性。
遵循本指南,它将帮助您根据自己的用途做出决定。
https://developer.android.com/training/appbar/index.html
<android.support.design.widget.CoordinatorLayout
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="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:margin="8dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:fitsSystemWindows="true">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<EditText ... />
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
在Google相册中,工具栏实际上是一个搜索栏,既有抽屉的图标,又有搜索图标,还有搜索栏的功能。有什么方法可以在我自己的应用程序中重新创建它而不是使用标准工具栏?如果需要,我可以提供屏幕截图。
Google 使用 "Material Design" (https://material.google.com/) 概念,因此搜索 "Material Design".
如果您有一个网络项目,请考虑 https://getmdl.io/ or https://material.angularjs.org 例如。
您需要使用应用栏布局并添加编辑文本。如果您希望工具栏看起来像浮动的,请指定 margin xml 属性。
遵循本指南,它将帮助您根据自己的用途做出决定。 https://developer.android.com/training/appbar/index.html
<android.support.design.widget.CoordinatorLayout
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="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:margin="8dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:fitsSystemWindows="true">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<EditText ... />
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>