2016-02-25 5 views
4

я хочу создать панель инструментов, как этот показано ниже:Пользовательские панели инструментов Android

enter image description here

проблема я имею в те получить значок половину на левой крайности. как я могу это получить? я был преуспевающим с Кете части, из которых код Даю ниже:

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true" 
    tools:context="com.app.InstHomeDir.NavigationView.InstaDrawer"> 

    <android.support.design.widget.AppBarLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:theme="@style/AppTheme.AppBarOverlay"> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="#da251c" 
      app:popupTheme="@style/AppTheme.PopupOverlay" > 

      <ImageView 
       android:id="@+id/icon_toolbar_instadrawer" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="left" 
       android:src="@drawable/logo2"/> 

      <TextView 
       android:id="@+id/header" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:textSize="15sp" 
       android:textColor="@color/white" 
       /> 
      <ImageView 
       android:id="@+id/call_toolbar_instadrawer" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="right" 
       android:src="@drawable/call_toolbar"/> 

     </android.support.v7.widget.Toolbar> 

    </android.support.design.widget.AppBarLayout> 

    <include layout="@layout/insta_content_drawer" /> 
</android.support.design.widget.CoordinatorLayout> 
+0

который иконку вы хотите на левой стороне? на самом деле я не понимаю –

+0

значок 3 строки –

+0

проверить мой ответ –

ответ

3

попробовать это будет определенно решить вашу проблему

добавить эту строку в панели инструментов

приложение: contentInsetStart = "0dp"

<android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="#da251c" 
      app:contentInsetStart="0dp" 
      app:popupTheme="@style/AppTheme.PopupOverlay" > 
+0

Большое вам спасибо –

Смежные вопросы