相关疑难解决方法(0)

ConstraintLayout外部的位置视图

我想将视图放置在的外部,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)

但这是结果
在此处输入图片说明

android android-constraintlayout

6
推荐指数
1
解决办法
3476
查看次数

标签 统计

android ×1

android-constraintlayout ×1