2016-08-09 7 views
0

enter image description hereWie wird man zusätzlichen Platz los neben Hamburger Symbol Navigationsleiste

ich das Layout haben wie in diesem Bild gezeigt, und das ist, wie mein xml wie folgt aussieht:

<?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" 
    app:contentInsetLeft="0dp" 
    app:contentInsetStart="0dp" 
    tools:context="pulsesecure.net.securewebbrowser.HomeActivity"> 

    <android.support.design.widget.AppBarLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:padding="0dp" 
     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="?attr/colorPrimary" 
      android:paddingTop="10dp" 
      android:paddingBottom="5dp" 
      app:popupTheme="@style/AppTheme.PopupOverlay"> 
      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="vertical"> 

       <LinearLayout 
        android:id="@+id/frag_toolbar" 
        android:layout_width="match_parent" 
        android:layout_height="0dp" 
        android:layout_weight="9" 
        android:orientation="horizontal" 
        android:visibility="gone"> 
        <TextView 
         android:id="@+id/frag_title" 
         android:layout_width="0dp" 
         android:layout_weight="9" 
         android:layout_height="match_parent" 
         android:textColor="@android:color/white" 
         android:gravity="center_vertical" 
         android:textAppearance="?android:attr/textAppearanceMedium" 
         /> 

        <ImageButton 
         android:id="@+id/add_tab_btn" 
         android:layout_width="0dp" 
         android:layout_weight="1" 
         android:layout_height="match_parent" 
         android:src="@mipmap/ic_add_white_24dp" 
         android:background="@color/colorPrimaryDark" 
         /> 
       </LinearLayout> 
       <LinearLayout 
        android:id="@+id/urlBar" 
        android:layout_width="match_parent" 
        android:layout_height="0dp" 
        android:layout_weight="9" 
        android:orientation="horizontal" 
        android:visibility="gone" 
        android:background="@color/colorPrimaryDark" 
        android:focusableInTouchMode="true" 
        > 
        <EditText 
         android:id="@+id/searchET" 
         android:layout_width="0dp" 
         android:layout_weight="9" 
         android:layout_height="match_parent" 
         android:textColor="@android:color/darker_gray" 
         android:layout_gravity="center" 
         android:imeOptions="actionGo" 
         android:singleLine="true" 
         android:hint="@string/hint_url" 
         android:selectAllOnFocus="true" 
         android:background="@drawable/rounded_edit_text" 
         /> 


        <ImageButton 
         android:id="@+id/delete_url" 
         android:layout_width="0dp" 
         android:layout_weight="1" 
         android:layout_height="match_parent" 
         android:layout_margin="5dp" 
         android:src="@mipmap/ic_clear_white_24dp" 
         android:background="@color/colorPrimaryDark" 
         /> 
       </LinearLayout> 

       <LinearLayout 
        android:id="@+id/select_url_bar" 
        android:layout_width="match_parent" 
        android:layout_height="0dp" 
        android:layout_weight="9" 
        android:orientation="horizontal" 
        android:visibility="gone" 
        android:background="@color/colorPrimaryDark" 
        android:focusableInTouchMode="true" 
        > 

        <TextView 
         android:id="@+id/url_text" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:layout_marginRight="5dp" 
         android:text="text view" 
         android:clickable="true" 
         android:singleLine="true" 
         android:gravity="center_vertical" 
         android:textColor="@android:color/black" 
         style="@style/PSFont" 
         android:background="@drawable/rounded_edit_text"/> 


       </LinearLayout> 

      </LinearLayout> 

     </android.support.v7.widget.Toolbar> 
     <ProgressBar 
      android:id="@+id/page_load_progress" 
      style="@android:style/Widget.ProgressBar.Horizontal" 
      android:layout_width="match_parent" 
      android:layout_height="3dp" 
      android:progressTint="@color/colorAccent" 
      android:visibility="invisible" 
      /> 
    </android.support.design.widget.AppBarLayout> 

    <include layout="@layout/content_home" /> 



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

I erhalten müssen Löschen Sie den Abstand zwischen dem Hamburger-Symbol und dem Editiertext (markiert mit dem orangefarbenen Pfeil). Ich habe versucht, Padding und Inset, aber bisher kein Glück. Kann mir jemand dazu Hinweise geben? Vielen Dank.

Antwort

0

Versuchen unter Attribut in Ihrem <android.support.v7.widget.Toolbar> hinzuzufügen.

app:contentInsetStartWithNavigation="0dp" 

Hinzufügen dies & funktionieren, wenn es noch nicht, dann funktioniert nur diese beiden Attribute hinzufügen sowie

app:contentInsetLeft="0dp" 
app:contentInsetStart="0dp" 
Verwandte Themen