2017-06-29 70 views
4

我有一个过滤按钮。我需要打开与下面给出的image.I相同的可扩展/下拉过滤器。我尝试了弹出菜单和Listpopup窗口,但是,我没有得到任何成功。如何在Android中显示特定视图下方的下拉列表视图?

enter image description here

预先感谢

+0

也许你可以使用可扩展的listview。 – Redman

+0

但是,如何?我需要确切的下方按钮,如上图所示。 – Vasant

+0

可扩展列表视图弹出窗口内 – Redman

回答

0

I,通过上述意见帮助做代码。但代码如下所示。

final View popUpView = getLayoutInflater().inflate(R.layout.exp, null); 
    listPopupWindow = new PopupWindow(popUpView, LinearLayout.LayoutParams.WRAP_CONTENT, 
      LinearLayout.LayoutParams.WRAP_CONTENT, true); 
    expandableListView= (ExpandableListView) popUpView.findViewById(R.id.expandableListView); 
    btnticker.setOnClickListener(new View.OnClickListener() { 
     @Override 
     public void onClick(View v) { 

      expandableListDetail = ExpandableListDataPump.getData(); 
      expandableListTitle = new ArrayList<String>(expandableListDetail.keySet()); 

      expandableListAdapter = new CustomExpandableListAdapter(MainActivity.this, expandableListTitle, expandableListDetail); 
      expandableListView.setAdapter(expandableListAdapter); 

      listPopupWindow.showAsDropDown(v); 
     } 
    }); 
1

,您可以利用片段,这将是过滤器按钮下方,布局将包括您所期望即上箭头,展开视图,或者你使用的任何视图中的UI .. 点击过滤器后刚可见片段与片段化,该效果可以用动画太...

这个我已经做了,你可以参考的过滤器按钮同一个dilog会来二手车section..click carwale应用..

任何事情让我知道更多..

+0

你可以分享代码吗? – Vasant

+0

亲爱的vasant我可以添加,但代码是如此之大,所以尝试自己.. –

相关问题