Skip to content Skip to sidebar Skip to footer

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 w

Solution 1:

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


Post a Comment for "Animate Listview From Back Of Layout"