2017-02-10 52 views
0

我在Android的新形象自定义工具栏development.Can谁能帮我,我怎么可以自定义工具栏像下面的图片如何使像被定描述

https://i.stack.imgur.com/R8yOn.png

+0

点击这里关于如何使用材料设计和主题http://www.androidhive.info/2015/04/android-getting-started-with-material-design/ – Tasos

回答

0
<?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="wrap_content" 
    android:background="@color/colorPrimary" 
    android:minHeight="?attr/actionBarSize" 
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
    app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
    android:contentInsetLeft="0dp" 
    android:contentInsetStart="0dp" 
    app:contentInsetLeft="0dp" 
    app:contentInsetStart="0dp" 
    android:contentInsetRight="0dp" 
    android:contentInsetEnd="0dp" 
    app:contentInsetRight="0dp" 
    app:contentInsetEnd="0dp" 
    > 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" 


     > 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Delivery Location" 
      android:layout_gravity="center" 
      android:textColor="#000" 
      android:id="@+id/toolbar_title" /> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Jiwaji Ganj" 
      android:layout_gravity="center" 
      android:textColor="@color/tabUnselectedIconColor" 
      android:id="@+id/toolbar_title_location" /> 
    </LinearLayout>