0
我正在創建具有searchBar by this lib屏幕的應用程序。 我的活動佈局是這樣的:ConstraintLayout中的Animate LayoutParams更改
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.constraint.ConstraintLayout
android:id="@+id/wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true">
<TextView
android:id="@+id/title"
android:textColor="@color/colorPrimary"
android:text="@string/mainScreenTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAlignment="center"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:paddingTop="100dp"/>
<com.arlib.floatingsearchview.FloatingSearchView
android:id="@+id/searchView"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="100dp"
android:animateLayoutChanges="true"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title"/>
</android.support.constraint.ConstraintLayout>
</RelativeLayout>
在那裏,我必須FloatingSearchingView移動到屏幕和變化高度的頂部,例如500dp - 這樣的:
app:layout_constraintTop_toTopOf="parent"
android:layout_height="500dp"
,我稍後會移動它回到並改變高度再次默認值
app:layout_constraintTop_toBottomOf="@+id/title"
android:layout_height="50dp"
問題是,我必須動畫。我花了很多時間尋找解決方案,但不幸的是我沒有找到任何東西。
我做params.topToBottom = -1和params.topToTop = R.id.wrapper內applyTransformation方法,但它仍然沒有動畫:C – Qiteq