I have alignment problem with TextInputLayout and Spinner, I want Spinner to emphasize alignment with EditText underline inside TextInputLayout. This is what I do:
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="bottom"> <android.support.design.widget.TextInputLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1"> <EditText android:id="@+id/txt_discipline_code" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/lbl_input_discipline_code"/> </android.support.design.widget.TextInputLayout> <Spinner android:id="@+id/spnnr_color_discipline_register" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/Base.Widget.AppCompat.Spinner.Underlined"> </Spinner> </LinearLayout>
But Spinner is a little lower . Can anybody help me? Thanks in advance.
EDIT:
Here is what I want: 
Having reached this alignment, set the Spinner layout_marginBottom to 1.5dp:
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="bottom"> <android.support.design.widget.TextInputLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1"> <EditText android:id="@+id/txt_discipline_code" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Code"/> </android.support.design.widget.TextInputLayout> <Spinner android:id="@+id/spnnr_color_discipline_register" android:layout_width="wrap_content" android:layout_height="wrap_content" style="@style/Base.Widget.AppCompat.Spinner.Underlined" android:layout_marginBottom="1.5dp"> </Spinner> </LinearLayout>
But I am afraid that this will not work properly in other devices with different sizes. Is this the only solution?
android android-layout android-spinner android-textinputlayout
caiofilipemr
source share