I'm trying to find out how I can create a pop-up menu bar, after I press on a checkbox item, so I can do multiple things like delete..
I've taken this idea f开发者_如何学Crom the Android videos:Google I/O 2009 -...Interaction & Visual Design with Android (link: http://developer.android.com/videos/index.html#v=wdGHySpipyA) , the 25:58 min.
Here is a screen shot I've made: http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs196.snc3/20366_322904078985_613608985_4870141_6451460_n.jpg
If anyone know about any tutorial, or article it will be fully estimated!
You just need to add a button bar View
at the bottom of your layout which initially has android:visibility="gone"
.
In your ListView
onItemClick
method, set the button bar's visibility to View.VISIBLE
(or back to GONE
) as appropriate.
You can also use a simple TranslateAnimation
to make the bar slide in and out at the same time you set it as visible/gone.
For example, in res/anim/slide_out.xml
:
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromYDelta="0"
android:toYDelta="100%"
android:duration="100"
/>
And when you mark the button bar as gone:
Animation animation = AnimationUtils.loadAnimation(this, R.anim.slide_out);
mButtonView.startAnimation(animation);
mButtonView.setVisibility(View.GONE);
精彩评论