Android 微调器下方的下划线未与EditText对齐';s下划线
我一直在读关于这个问题的帖子,但没有一个解决方案能解决我的问题。 我正在使用Android 微调器下方的下划线未与EditText对齐';s下划线,android,xml,android-spinner,Android,Xml,Android Spinner,我一直在读关于这个问题的帖子,但没有一个解决方案能解决我的问题。 我正在使用style=“@style/Base.Widget.AppCompat.Spinner.下划线向微调器添加下划线,但由于某些原因,微调器的基线未与编辑文本对齐。 这是我的XML: <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation=
style=“@style/Base.Widget.AppCompat.Spinner.下划线
向微调器添加下划线
,但由于某些原因,微调器的基线
未与编辑文本
对齐。
这是我的XML:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="5">
<!-- Phone Country code Spinner -->
<Spinner
android:id="@+id/spProfileDetailsUser_phoneNumberCode"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
style="@style/Base.Widget.AppCompat.Spinner.Underlined"
android:layout_gravity="bottom">
</Spinner>
<!-- Mobile Number Label -->
<android.support.design.widget.TextInputLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_weight="4">
<EditText android:id="@+id/etProfileDetailsUser_phoneNumber"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="number"
android:hint="Mobile Number"
/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
我已经尝试过针对类似问题找到的任何解决方案,因此尝试将微调器
下划线与EditTxt
对齐。但是,没有帮助。例如
我正在寻找解决此问题的解决方案或变通方法
谢谢只需从您的文本输入版面中删除android:layout\u marginBottom=“8dp”:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="5"
xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Phone Country code Spinner -->
<Spinner
android:id="@+id/spProfileDetailsUser_phoneNumberCode"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
style="@style/Base.Widget.AppCompat.Spinner.Underlined"
android:layout_gravity="bottom">
</Spinner>
<!-- Mobile Number Label -->
<android.support.design.widget.TextInputLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_weight="4">
<EditText android:id="@+id/etProfileDetailsUser_phoneNumber"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="number"
android:hint="Mobile Number"
/>
</android.support.design.widget.TextInputLayout>
摆脱
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
您会没事的您是否尝试过将android:baselineAligned=“false”
应用到LinearLayout
?