2015-11-13 7 views
6

Ich baue eine App, die einige AutoCompleteTextView hat, mit amterial Design AppCompat. Ich muss die Hinweisanimation entfernen, die diese Komponente hat, wenn Sie in einer glatten Animation auf das Feld tippen und der Hinweis nach oben geht. Gibt es eine Möglichkeit, diese Animation zu entfernen?Android Material Design: Entfernen Hinweis Animation

Mein Layout:

<!-- Login progress --> 
<ProgressBar android:id="@+id/login_progress" style="?android:attr/progressBarStyleLarge" 
    android:layout_width="wrap_content" android:layout_height="wrap_content" 
    android:layout_marginBottom="8dp" android:visibility="gone" /> 

<LinearLayout android:id="@+id/login_form" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 

    <LinearLayout android:id="@+id/email_login_form" android:layout_width="match_parent" 
     android:layout_height="match_parent" android:orientation="vertical"> 

     <android.support.design.widget.TextInputLayout android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <AutoCompleteTextView android:id="@+id/email" android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="@string/prompt_email" 
       android:inputType="textEmailAddress" 
       android:maxLines="1" 
       android:singleLine="true" 
       android:theme="@style/AutoCompleteTextViewListasVipHolo" /> 

     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <EditText android:id="@+id/password" android:layout_width="match_parent" 
       android:layout_height="wrap_content" android:hint="@string/prompt_password" 
       android:imeActionId="@+id/login" 
       android:imeActionLabel="@string/action_sign_in_short" 
       android:imeOptions="actionUnspecified" android:inputType="textPassword" 
       android:maxLines="1" android:singleLine="true" /> 

     </android.support.design.widget.TextInputLayout> 

     <Button android:id="@+id/email_sign_in_button" 
      style="?android:textAppearanceSmall" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="16dp" 
      android:text="@string/action_sign_in" 
      android:textStyle="bold" /> 

     <Button android:id="@+id/register_button" 
      style="?android:textAppearanceSmall" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="16dp" 
      android:text="@string/action_register" 
      android:textStyle="bold" /> 

    </LinearLayout> 
</LinearLayout> 

Ich möchte nicht, dass die Auto-Vervollständigen-Funktion verlieren.

+0

Veröffentlichen Sie Ihr Layout mindestens. Es wird viel einfacher sein, Sie –

+0

erickles

+0

@erickles Veröffentlichen Sie Ihre volle xml –

Antwort

4

Wenn Sie das schwebende Etikett entfernen möchten, entfernen Sie die TextInputLayout Verpackung um Ihre AutoCompleteTextView. Dadurch wird die Funktion der schwebenden Beschriftung entfernt.

Wenn Sie das Floating-Label, sondern um die Animation deaktivieren, dann mit der Unterstützung Design-Bibliothek v23 Sie textInputLayout.setHintAnimationEnabled(false); im Code

oder app:hintAnimationEnabled="true" als Parameter an die TextInputLayout in XML verwenden können.

+1

Ich entfernte das TextInputLayout und arbeite es! Ich danke dir sehr! – erickles

+1

Gern geschehen. Froh, dass es geholfen hat. –