2017-01-25 13 views
2

Material Design LiteのText Fieldのように、AndroidアプリケーションでEditTextのボトムラインカラーアニメーションを実装したいと思います。私の研究では何も見つかりませんでした(すべての結果はフローティングラベルに関するものです)。ライブラリやその他の参考資料でこれらのアニメーションを作成する方法は?質問の明確化素材デザイン - EditTextの最終行カラーアニメーション


EDIT

、私は一番下の行を作る方法を、左とフィールドの右側(ない浮動ラベルには、中央から拡大するボトムラインアニメーションをしたいです色の変更、フォームの検証など)。

テキストフィールドコンポーネントをフォーカスするとアニメーションが表示され、参照しているアニメーションが表示されます。

おかげで、ハンブルポテトII

答えて

0
You can create XML Layout like this way 
    <?xml version="1.0" encoding="utf-8"?> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/rl" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@color/color_bg" 
     android:orientation="vertical"> 
    <android.support.design.widget.TextInputLayout 
      android:id="@+id/tv_user_name" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_centerHorizontal="true" 
      android:layout_margin="@dimen/common_layout_dimen_10" 
      android:textColorHint="@color/color_black"> 

      <EditText 
       android:id="@+id/et_user_name" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:ellipsize="end" 
       android:hint="@string/lbl_name" 
       android:imeOptions="actionNext" 
       android:inputType="textCapWords" 
       android:maxLines="1" 
       android:singleLine="true" 
       android:textColor="@color/color_black" 
       android:textSize="@dimen/common_text_size_20" /> 
     </android.support.design.widget.TextInputLayout> 
    </RelativeLayout> 
+0

ここで、あなたはカラーアニメーションを持っていますか? – Christian

+0

ええ、アニメーションXMLが必要になると思いましたか? –

0

あなただけTextInputLayoutを使用する必要があります。 使用this参照。

+0

MDLの[Text Field](https://getmdl.io/components/index.html#textfields-section)のように、中央から左右にアニメーション化された拡大ボトムラインの色を期待していました。 –

関連する問題