にあなたがアニメーター資源の下でセレクタを使用することができます。
<!-- res/animator/text_size.xml -->
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true">
<set>
<objectAnimator
android:duration="0"
android:propertyName="textSize"
android:valueTo="18sp"
android:valueType="floatType"/>
</set>
</item>
<item android:state_focused="false">
<set>
<objectAnimator
android:duration="0"
android:propertyName="textSize"
android:valueTo="10sp"
android:valueType="floatType"/>
</set>
</item>
</selector>
あなたが値にまっすぐにジャンプする0時間を持つことができますまたはそこに継続時間を置く。それを使用する
その後は、あなたのビューにandroid:stateListAnimator
を設定します。
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 3"
android:stateListAnimator="@animator/text_size"/>
を、私はあなたと同じ質問を持っているが、まだ答え:) –