7

ile hizalama sorunu sorunu TextInputLayout ve Spinner ile bir hizalama sorunu yaşıyorum, Spinner'ın TextInputLayout öğesinin içindeki EditText alt çizgisiyle hizalanmasını istiyorum. Bu benim yaptığım budur:TextInputLayout ve Spinner

<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> 

Ama Spinner bir little bit below olduğunu. Bana yardım edebilecek kimse var mı? Şimdiden teşekkürler.

DÜZENLEME:

The Y underline of the EditText equal to the Y underline of the Spinner Ben 1.5dp Spinner`ın layout_marginBottom ayarı bu uyumun sağlanabilmesi:

<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> 

Ama bu olmaz korkuyorum İşte

benim istediğim şey Farklı boyutta başka aygıtta düzgün çalış. Tek çözüm bu mu? Bu kod

enter image description here

kullanımını:: Bu sonuca ulaşmak istiyoruz söz kadarıyla

+0

Düzenlenmiş cevabımı kontrol edin –

cevap

2

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    android:gravity="bottom" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:baselineAligned="false"> 

    <LinearLayout 
     android:orientation="horizontal" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_weight="1"> 

     <ImageView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      app:srcCompat="@drawable/ic_launcher" 
      android:id="@+id/imageView" 
      android:padding="10dp" 
      android:layout_weight="5" /> 

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_weight="1"> 
      <EditText 
       android:id="@+id/name_text" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_weight="0.5" 
       android:hint="Name"/> 
     </android.support.design.widget.TextInputLayout> 
    </LinearLayout> 

    <LinearLayout 
     android:orientation="horizontal" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_weight="1"> 

     <ImageView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      app:srcCompat="@drawable/ic_launcher" 
      android:id="@+id/imageView1" 
      android:padding="10dp" 

      android:layout_weight="1.1" /> 

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="-12dp" 
      android:layout_marginStart="-12dp" 
      android:layout_weight="0.6"> 
      <EditText 
       android:id="@+id/code_text" 
       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="match_parent" 
      android:layout_weight="1" 
      android:layout_height="wrap_content"/> 
    </LinearLayout> 

    <LinearLayout 
     android:orientation="horizontal" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_weight="1"> 

     <ImageView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      app:srcCompat="@drawable/ic_launcher" 
      android:id="@+id/imageView2" 
      android:padding="10dp" 
      android:layout_weight="5" /> 

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_weight="1"> 
      <EditText 
       android:id="@+id/foo_text" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_weight="0.5" 
       android:hint="Foo"/> 
     </android.support.design.widget.TextInputLayout> 
    </LinearLayout> 


</LinearLayout> 

yardımcı olur Umut !!!

+0

Cevabınız için teşekkür ederim, ancak bunu başarmak istiyorum -> [link] (http://imgur.com/a/ivuWg), telefon simgesi olan hat. – caiofilipemr

+0

neden bunu baştan söylemedin? –

+0

Üzgünüm (açıklamam, ingilizcem, yerel lang değil), telefonun simgesiyle ilgili olarak size sadece nereye bakacağımı göstereceğim, simgeyi istemiyorum, sadece EditText ve Bu çizgide spinner var. Sorumu daha açık hale getirmek için düzenledim. Bir çözüm buldum, ancak her ayırımcı için geçerli olup olmadığından emin değilim. Teşekkür ederim! – caiofilipemr