Reputation: 301
using sdk 2.3
I have a view at the bottom of the screen that I want to slide out so I use this code
FrameLayout ll1 = (FrameLayout) findViewById(R.id.bottom_panel);
Animation anim1 = AnimationUtils.loadAnimation(this, R.anim.slideoutbottom);
anim1.setInterpolator((new
AccelerateDecelerateInterpolator()));
anim.setFillAfter(true);
ll1.setAnimation(anim1);
ll1.setVisibility(View.GONE);
xml:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="0%p" android:toYDelta="45%p" android:duration="500" android:zAdjustment="bottom"/>
</set>
THe problem I have is that there is a view in the middle of the screen which is expanding to fill the space left by the view sliding out. I don't want this to happen, I just need the view in the middle to stay where it is and I will fade this one out.
How to solve Thanks
Upvotes: 2
Views: 2621
Reputation: 1452
Instead of setting the visibility to View.GONE
, use View.INVISIBLE
.
In that way, the view you slide out will remain occupying the space on the screen.
Upvotes: 1