【问题标题】:Animate layout to fill screen动画布局以填满屏幕
【发布时间】:2015-12-16 06:14:09
【问题描述】:

我正在尝试在 Google 的 Play 报亭应用中复制此动画:

http://i.imgur.com/UuX1PRO.webm

我的布局看起来像这样:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="8dp"
    android:paddingRight="8dp"
    android:paddingTop="8dp"
    android:orientation="vertical">

    <LinearLayout
        android:id="@+id/post"
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:orientation="vertical">

        ... more layouts ...

    </LinearLayout>

</LinearLayout>

如何将LinearLayout(ID为post)扩展至屏幕?请注意,所有帖子的高度均为 250dp。当帖子扩展到屏幕时,我想加载对其下方帖子所做的回复(cmets 部分)。

如何创建此动画/展开效果?

【问题讨论】:

    标签: android android-layout android-animation android-xml


    【解决方案1】:

    你需要使用材料设计活动过渡

    here

    getWindow().setExitTransition(new Explode());
    

    查看this

    【讨论】:

      【解决方案2】:

      您需要使用Activity 转换。文章视图其实是不一样的Activity。请参阅文档:http://developer.android.com/training/material/animations.html#Transitions

      【讨论】:

        【解决方案3】:

        您可以简单地将以下代码行添加到您的 Activity.onCreate();

        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        

        【讨论】:

          【解决方案4】:

          这不是确切的解决方案,但我认为开发者网站上的 this page 正是您正在寻找的。​​p>

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2017-01-25
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多