android 如何在特定视图下方显示下拉列表视图?

How to display drop-down list-view below particular view in android?

我有一个过滤器 button.I 需要打开 expandable/dropdown 过滤器,如下所示 image.I 尝试了弹出菜单和 Listpopup window 但是,我没有得到任何成功.

在此先感谢

我在上面的评论的帮助下编写了代码。但代码如下所示。

    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);
        }
    });

您可以使用过滤器按钮下方的片段,布局将包括您期望的 ui,即上箭头和可扩展视图或您正在使用的任何视图。 点击滤镜后只看到片段和片段过渡,对于效果你也可以使用动画...

我已经完成了,你可以参考 carwale 应用二手车部分..点击过滤器按钮会出现一个相同的 dilog..

任何事情让我进一步了解..