2016-01-18 3 views
0

Я создаю свой собственный пользовательский режим поиска. Но на левой стороне предпочтительного виджета есть пустое пространство. Как я могу избавиться от него?Android: Пользовательские предпочтения удаляют нежелательные дополнения/поля?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@android:id/widget_frame" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 

    <TextView 
     android:id="@+id/seekBarPrefUnitsRight" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentTop="true"></TextView> 

    <TextView 
     android:id="@+id/seekBarPrefValue" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_toLeftOf="@id/seekBarPrefUnitsRight" 
     android:gravity="right"></TextView> 

    <TextView 
     android:id="@+id/seekBarPrefUnitsLeft" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_toLeftOf="@id/seekBarPrefValue"></TextView> 

    <LinearLayout 
     android:id="@+id/seekBarPrefBarContainer" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_below="@+id/seekBarPrefUnitsRight" 
     android:orientation="horizontal"> 

     <SeekBar 
      android:id="@+id/seekBarPrefSeekBar" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" /> 
    </LinearLayout> 
</RelativeLayout> 

Я выделяю желтое нежелательное пространство.

enter image description here

ответ

0

вы можете попробовать играть с отрицательными значениями маржи или обивка на отдельном элементе, в зависимости от вашего желания.

0

Использование ниже код:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@android:id/widget_frame" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:orientation="vertical" > 

<RelativeLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:padding="6dp" > 

    <TextView 
     android:id="@+id/tvCheckItOut" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_centerVertical="true" 
     android:paddingBottom="5dp" 
     android:text="Check it out" 
     android:textStyle="bold" > 
    </TextView> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_below="@+id/tvCheckItOut" 
     android:text="Check it out" > 
    </TextView> 

    <CheckBox 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentRight="true" 
     android:layout_centerVertical="true" /> 
</RelativeLayout> 
<RelativeLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:padding="6dp" > 

    <TextView 
     android:id="@+id/tvSeekbarSummary" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_centerVertical="true" 
     android:paddingBottom="5dp" 
     android:text="SeekBar" 
     android:textStyle="bold" > 
    </TextView> 
    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_below="@+id/tvSeekbarSummary" 
     android:text="Summary" > 
    </TextView> 

</RelativeLayout> 
<SeekBar 
    android:id="@+id/seekBarPrefSeekBar" 
    android:layout_width="fill_parent" 
    android:progress="100" 
    android:layout_height="wrap_content" /> 

</LinearLayout> 
Смежные вопросы