选择前微调器元素未显示正确的视图
Spinner Element not showing proper view before selection
在此处输入图片描述[我有 4 个微调器,在选择第一个微调器后,第二个微调器项目将 come.When 我打开它显示的页面像图像一样,第一个文本在正确的位置,但第三个元素有一些差距,当我选择第一个项目时,第二个项目会自动选择其列表中的一个,并且没有我在图像中提到的差距。请帮我解决这个问题。
我布局中的这个微调器
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:entries="@array/subloc"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingTop="10dp"
android:textSize="18sp"
/>
微调项是:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="#000"
android:textSize="15sp"
android:text="dvvdv"/>
]
尝试像下面这样更改 Spinner Item。
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="#000"
android:paddingTop="15dp"
android:paddingBottom="15dp"
android:textSize="15sp"
android:text="dvvdv"/>
第一步:
尝试使用默认的 android.R.layout.simple_spinner_dropdown_item 作为微调器下拉菜单,它将完美显示而没有任何 space
orelse
//第二步:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:hint="Select item"
android:background="@drawable/spin"/>
</RelativeLayout>
可能你在Select Subnature String[=15 之前添加了space =].尝试删除 space.
在此处输入图片描述[我有 4 个微调器,在选择第一个微调器后,第二个微调器项目将 come.When 我打开它显示的页面像图像一样,第一个文本在正确的位置,但第三个元素有一些差距,当我选择第一个项目时,第二个项目会自动选择其列表中的一个,并且没有我在图像中提到的差距。请帮我解决这个问题。
我布局中的这个微调器
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:entries="@array/subloc"
android:gravity="left"
android:paddingBottom="5dp"
android:paddingTop="10dp"
android:textSize="18sp"
/>
微调项是:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="#000"
android:textSize="15sp"
android:text="dvvdv"/>
]
尝试像下面这样更改 Spinner Item。
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="#000"
android:paddingTop="15dp"
android:paddingBottom="15dp"
android:textSize="15sp"
android:text="dvvdv"/>
第一步: 尝试使用默认的 android.R.layout.simple_spinner_dropdown_item 作为微调器下拉菜单,它将完美显示而没有任何 space orelse
//第二步:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:hint="Select item"
android:background="@drawable/spin"/>
</RelativeLayout>
可能你在Select Subnature String[=15 之前添加了space =].尝试删除 space.