如何向上和向下运动

我是android的新手。我想通过上下移动来显示活动。 (我们可以在许多音乐播放器中看到它)。但是我不知道该怎么做。请给我一些解决方案,示例或建议。

如何向上和向下运动

bilong1988 回答:如何向上和向下运动

Какдела?

建议:您可能会在以下链接中找到所有疯狂的动画,包括2D和3D动画。我没有足够的时间找到确切的时间,但我确定它们存在于以下收藏中。

https://android-arsenal.com/tag/6?sort=created

建议:您可以使用Android SDK中的动画API轻松实现它。或者您可以在这里找到一些相关的答案

Make activity animate from top to bottom

祝你好运。

,

最后,我决定使用Android Bottom Sheet。这是代码示例:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/bottom_sheet"
    android:layout_width="match_parent"
    android:layout_height="340dp"
    android:background="@android:color/darker_gray"
    android:orientation="vertical"
    app:behavior_hideable="true"
    app:behavior_peekHeight="80dp"
    app:layout_behavior="android.support.design.widget.BottomSheetBehavior">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="80dp"
        android:background="@color/colorAccent"
        android:gravity="center"
        android:text="@string/bottom_sheet_peek"
        android:textColor="@android:color/white" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:text="@string/bottom_sheet_content"
        android:textColor="@android:color/white" />

</LinearLayout>

result

本文链接:https://www.f2er.com/3126713.html

大家都在问