您可以试用滑动抽屉。
或者对于这种动画,您需要一个布局,放置在底部并添加一个onThumbTouchListener。因为这是我起诉我的要求
像这样的事情
OnTouchListener onThumbTouch = new OnTouchListener()
{
@Override
public boolean onTouch(View v, MotionEvent event)
{
switch(v.getId())
{
case R.id.slider_thumb_id:
{
switch(event.getAction())
{
case MotionEvent.ACTION_MOVE:
{
if(v.getTop()>=0 && v.getBottom()<sliderFrame.getMeasuredHeight()){
int topPos = (int)event.getRawY()-(v.getHeight()*2+v.getHeight());
if(topPos < 0) {
topPos=0;
} else if(topPos > (sliderFrame.getMeasuredHeight()-v.getMeasuredHeight())){
topPos = (sliderFrame.getMeasuredHeight()-v.getMeasuredHeight()) -1;
}
iconParams.topMargin = topPos;
v.setLayoutParams(iconParams);
sliderThumbFake.setLayoutParams(iconParams);
}
break;
}
case MotionEvent.ACTION_UP:
{
}
}
break;
}
}
return true;
}
};
case语句中的代码可能不会有用。但是,你如何做一个视图拖动。
滑动抽屉是要走的路。谢谢 – Edgar