我的旋转器下拉列表左侧的白线

时间:2017-09-20 12:06:27

标签: android xml user-interface layout spinner

我尝试将边距和填充设置为0,但无法摆脱它。

这是一个截图: enter image description here

这是我的下拉列表的xml:

var anchorPoints = [];
var anchorConnectors = [];
var anchorPointAmount = 20;
var xvals = [];
var yvals = [];
const cenX = window.innerWidth / 2;
const cenY = window.innerHeight / 2;

function setup() {
    createCanvas(window.innerWidth, window.innerHeight);
    frameRate(60);
    for (i = 0; i < anchorPointAmount; i++) {
        xvals.push(random(0, window.innerWidth));
        yvals.push(random(0, window.innerHeight));
        anchorPoints[i] = new AnchorPoint(xvals[i], yvals[i]);
        for (j = 0; j < anchorPointAmount; j++) {
             console.log(i, j)
             anchorConnectors[j * i] = new AnchorConnector(xvals[i], yvals[i], xvals[j * 2], yvals[j * 2]);
        }
     }
     console.log(xvals);
     console.log(yvals);
}

和旋转器:

<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
                 android:id="@android:id/text1"
                 android:layout_width="match_parent"
                 android:background="@color/j3PreferencesBackground"
                 android:checkMark="@drawable/btn_checkbox_s3_pref_j3"
                 android:layout_height="50dp"
                 android:ellipsize="end"
                 android:gravity="center_vertical"
                 android:minHeight="22dp"
                 android:paddingLeft="6dp"
                 android:paddingRight="10dp"
                 android:maxLines="1"
                 android:textColor="@color/j3Gray70"
                 android:textSize="18sp"/>

1 个答案:

答案 0 :(得分:0)

尝试添加带有0dp的填充 layout_gravity 作为左侧。

<Spinner
        android:id="@+id/settingsSetSpinner"
        android:background="@color/j3PreferencesBackground"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="left"
         android:padding="0dp"     
        android:layout_below="@+id/settingsPickerTitle"
        android:defaultValue="0"
        android:entries="@array/import_export_locations"/>

有关详细信息,请参阅此链接Remove Spacing or Padding in android Spinner