我想将视图放置在的外部,ConstraintLayout以使用滑动动画对其进行动画处理。我尝试过设置约束,例如,constraintBottom_toTopOf="parent"但View停留在容器内。
请注意,我想通过使用内置动画而不是代码内动画的约束来实现这一目标。
知道我该怎么做吗?
我正在使用compile 'com.android.support.constraint:constraint-layout:1.1.0-beta1'
Android Studio 3.0 Beta 7
这是一个简单的xml文件,应将视图放置在容器之外:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/colorAccent">
<View
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@color/colorPrimary"
app:layout_constraintBottom_toTopOf="parent"/>
</android.support.constraint.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)