Animation In Relativelayout To Slide Down
I need help to animate a RelativeLayout. The next image explain how is my aplication: Now, when I touch a marker of a map, it displays a RelativeLayout (call Marker Title in the p
Solution 1:
You'd have to figure out a way to calculate the height of your map and reduce that from the animation start position. That way, the animation starts at its current location, vs the top of the screen.
Another way to do this, is a clever layout trick.
Below, is some sample code of how you would layer a LinearLayout over your Map view using a FrameLayout. You set the transparent view weight to 1, so that when you toggle the TextView to GONE, it expands to fill the space. In order to animate this change, add animateLayoutChanges="true"
to the enclosing views.
Example:
<FrameLayoutandroid:layout_width="match_parent"android:layout_height="match_parent" ><Map...
/><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:animateLayoutChanges="true" ><Viewandroid:id="@+id/transparentViewThatExpandsWhenTextIsGone"android:layout_width="match_parent"android:layout_height="0dp"android:layout_weight="1" /><TextViewandroid:id="@+id/textViewToToggle"android:layout_width="match_parent"android:layout_height="wrap_content"android:visibility="gone" /></LinearLayout></FrameLayout>
Post a Comment for "Animation In Relativelayout To Slide Down"