我一直在閱讀SO上的帖子,沒有任何解決方案解決了我的問題。 Im使用style="@style/Base.Widget.AppCompat.Spinner.Underlined
爲Spinner
添加了下劃線,但由於某些原因,spinner的baseline
未與EditText
對齊。 這裏是我的XML:微調下方的下劃線未與EditText的下劃線對齊
<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>
下面是結果:
我曾嘗試任何解決方案,我發現類似的問題對SO試圖對準spinner
與EditTxt
強調。但是,沒有幫助。如this post。
我正在尋找解決方案或解決方法來解決此問題。
感謝
你有沒有嘗試將'android:baselineAligned =「false」'應用於'LinearLayout'? – azizbekian