Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
199 views
in Technique[技术] by (71.8m points)

android - Animate listview from back of layout

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.

When I click layout it will slide my list-view see the next image

It will slide and hold beside layout but slide from front of layout and I want from back of layout

Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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>

enter image description here

This will make Textview over 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>

enter image description here

This will make Button over TextView

1st case code

<RelativeLayout > 
<TextView> 
<Button>

2nd case code

<RelativeLayout > 
<Button> 
<TextView>

in Short you can maintain order by following code hierarchy


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...