【问题标题】:Z order for animation in LinearLayoutLinearLayout中动画的Z顺序
【发布时间】:2015-03-24 06:25:01
【问题描述】:

我有一个带有 LinearLayout 的活动: -自定义工具栏 --DynamicallyScaledItems -ContentFrame(屏幕的其余部分) --通过不断变化的片段实现

当点击 CustomToolbar 的一个 Item 时,它会增长(同时 CustomToolbar 也会增长),并且 ContentFrame 应该在 CustomToolbar 后面动画向上替换片段并再次向下移动。

如果 ContentFrame 的 Z 顺序在 CustomToolbar 之后,这将很容易。但我无法将 CustomToolbar 拉到前面,因为它也会改变 LinearLayout 中的 Y 顺序。

我该如何解决这个问题?

使用相对布局?我如何定义 ContentFrame 将始终占据 CustomToolbar 下方的其余屏幕?

谢谢, 米克

【问题讨论】:

    标签: android animation android-linearlayout z-order


    【解决方案1】:

    使用RelativeLayout 和ContentFrame 的以下参数解决了这个问题: android:layout_alignParentBottom="true" android:layout_below="@+id/toolbar"

    【讨论】:

      猜你喜欢
      • 2012-08-22
      • 2012-08-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多