Android – how do I slide the button bar in from the bottom when I click a check box in the listview?

I have a custom listadapter list view, which fills the list view with check boxes and some text views. When the user selects a check box, I need a button bar to slide into the view from the bottom of the screen and sit there. I have made a button bar, which can be displayed and disappeared on the screen by changing its visibility to "disappeared" and "visible", But it doesn't perform these operations through slide in and slide out effects. How can I make it do those animations?

resolvent:

You want to use animation XML resources

The following is an example of an animation XML that "slides" an object from the bottom of the screen to a position in the layout:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate android:fromYDelta="100%p" android:toYDelta="0%p" android:duration="300"/>
</set>

You'll put it in the RES / anim folder and use this java code to animate the view:

slideUpIn = AnimationUtils.loadAnimation(this, R.anim.slide_up_in);
yourButtonBarView.startAnimation(slideUpIn);

You need to put the startanimation call in the get Check@R_ 622_ 2419 @ location of callback checked

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>