2015-01-22 2 views
0

Пожалуйста, помогите! Я полностью застрял и не могу найти решение. Используемая ширина моей панели инструментов ограничена элементами меню в ней. Here's a screenshot. Мне нужно, чтобы он не был ограничен элементами меню, поэтому мой EditText может охватывать ширину панели инструментов. Вот мой файл макета:Ширина панели инструментов Android ограничена пунктами меню

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/container" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    android:orientation="vertical" 
    tools:context=".MainActivity" 
    tools:ignore="MergeRootFrame"> 

    <android.support.v7.widget.Toolbar 
     android:id="@+id/toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="250sp" 
     android:background="@color/primary" 
     android:gravity="bottom" 
     android:minHeight="?attr/actionBarSize"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <Button 
       android:id="@+id/button_id" 
       android:layout_width="40sp" 
       android:layout_height="40sp" 
       android:layout_gravity="center" /> 

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

       <TextView 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:text="@string/url" 
        android:textColor="@color/accent" 
        android:textSize="16sp" /> 

       <EditText 
        android:id="@+id/url_text_field_id" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:inputType="textNoSuggestions" 
        android:maxLines="1" /> 

       <TextView 
        android:id="@+id/output_text_view_id" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:text="@string/initial_output_text_id" 
        android:textSize="16sp" /> 
      </LinearLayout> 
     </LinearLayout> 
    </android.support.v7.widget.Toolbar> 

    <ListView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"/> 

</LinearLayout> 

ответ

1

Похоже, что заполнение контента. Вот еще один ответ на этот вопрос: Android API 21 Toolbar Padding

Решение похоже app:contentStart xml атрибут на Toolbar вид. Я предполагаю, что contentEnd существует.

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