How to make a buttons bar slide in from bottom upon clicking checkbox in ListView?

前端 未结 2 893
天涯浪人
天涯浪人 2021-01-14 13:30

I have a listview with custom listadapter, which populates the listview with a checkbox and some textviews. When the user selects a checkbox, I need a button bar to slide in

2条回答
  •  隐瞒了意图╮
    2021-01-14 14:16

    You want to use Animation xml resources.

    Here is an example of an Animation xml that will 'slide' the object up from the bottom of the screen to where ever its place is within your layout:

    
    
        
    
    

    You will put that in your res/anim folder then use this java code to animate your view:

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

    You'll want to put the startAnimation call inside where you get the callback that your CheckBox has been checked.

提交回复
热议问题