Confetti Android 的定位/设置方向

问题描述

我正在开发一个安卓应用程序。我已经实现了以下库: nl.dionsegijn:konfetti:1.3.2。这个库允许你显示五彩纸屑,但我有一个小问题。我试图让五彩纸屑来自顶部,但它只来自左上角。请参阅以下屏幕截图。

click link to see screenshot

这是我的 xml 布局文件中的代码

<nl.dionsegijn.konfetti.KonfettiView
        android:id="@+id/viewKonfetti"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">
</nl.dionsegijn.konfetti.KonfettiView>

这是我的 kotlin 文件中的代码

viewKonfetti.build()
   .addColors(Color.parseColor("#FFD700"),Color.parseColor("#FD7F20"))
   .setDirection(0.0,359.0)
   .setSpeed(1f,5f)
   .setFadeOutEnabled(true)
   .setTimetoLive(2000L)
   .addShapes(Shape.Square,Shape.Circle)
   .addSizes(Size(12))
   .streamFor(500,StreamEmitter.INDEFINITE)

here is the link to the github repository of this library

任何有关如何使五彩纸屑从顶部出现的帮助将不胜感激。提前致谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)