自定义微调器上的小错误 space
Little bug space on Custom Spinner
我只是将我的微调器自定义视图设置为下拉列表,它得到了支持。但是不知何故,在“15”文本下方出现了一点 space,因此它不会在水平方向上呈线性。
这是我的代码:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/white"
android:textAlignment="center"
android:background="@drawable/timepickerbutton"
android:paddingEnd="20dp"
app:drawableEndCompat="@drawable/ic_arrow_down_sign_to_navigate" />
尝试将高度参数更改为 wrap_content 并将宽度更改为 fill_parent
我的一个项目中有下一个自定义微调项,后面没有任何其他布局,只有纯 XML 文件和一个 TextView,它按预期工作:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/customSpinnerItemTextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dip"
android:textColor="@color/vectorColor"
android:textSize="20sp"
tools:text="sometext" />
我只是将我的微调器自定义视图设置为下拉列表,它得到了支持。但是不知何故,在“15”文本下方出现了一点 space,因此它不会在水平方向上呈线性。
这是我的代码:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/white"
android:textAlignment="center"
android:background="@drawable/timepickerbutton"
android:paddingEnd="20dp"
app:drawableEndCompat="@drawable/ic_arrow_down_sign_to_navigate" />
尝试将高度参数更改为 wrap_content 并将宽度更改为 fill_parent
我的一个项目中有下一个自定义微调项,后面没有任何其他布局,只有纯 XML 文件和一个 TextView,它按预期工作:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/customSpinnerItemTextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dip"
android:textColor="@color/vectorColor"
android:textSize="20sp"
tools:text="sometext" />