Android:自定义偏好删除不需要的填充/边距?

时间:2016-01-18 12:11:34

标签: android android-preferences

我正在创建自己的自定义搜索栏首选项。但是首选项小部件的左侧有空白区域。我怎么能摆脱它?

<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

2 个答案:

答案 0 :(得分:0)

根据您的需要,您可以尝试在单个元素上使用保证金或填充的负值。

答案 1 :(得分:0)

使用以下代码:

 cmd /C /V "set "GIT_CURL_VERBOSE=1" && git push"
相关问题