从布局背面动画列表视图 [英] Animate listview from back of layout

查看:28
本文介绍了从布局背面动画列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作动画,我有一个布局和列表视图,我正在从左到右将动画应用于列表视图,它工作正常,但列表视图幻灯片位于布局前面,我想做从布局背面.

I am working on animation, I have one Layout and list-view and I am applying animation to list-view from left to right, Its working fine but list-view slide front of layout and I want to do from back of layout.

点击布局列表视图将从左向右滑动,并保持布局旁边的位置,如下图所示.

On click of layout list-view will slide from left to right and it hold the place beside layout like below images.

谢谢.

推荐答案

尝试理解视图顺序(Hierarchy)举个例子说明一下

Try to Understand the View order(Hierarchy) let me make it clear with an example

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
> 

<TextView 
android:id="@+id/tvMessage" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:text="dasdjfiuihuhds" /> 
<Button 
android:id="@+id/btnOk" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:text="Ok" /> 

</RelativeLayout>

这将使 Textview 超过 ButtonView

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
> 
<Button 
android:id="@+id/btnOk" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:text="Ok" /> 
<TextView 
android:id="@+id/tvMessage" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:text="dasdjfiuihuhds" /> 

</RelativeLayout>

这将使 Button 覆盖 TextView

第一种情况代码

<RelativeLayout > 
<TextView> 
<Button>

第二种情况代码

<RelativeLayout > 
<Button> 
<TextView>

简而言之,您可以通过以下代码层次结构维护订单

这篇关于从布局背面动画列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆