2015-09-17 14 views
1

This is how the Amazon app implements it's filter in android, can someone please tell me how to implement this, I have tried PopupMenu, Fragment and some other things but not at all able to achieve any thing like this如何在android中實現這樣的Popup

有人能告訴我如何在android應用程序中實現此功能。如果你可以分享代碼,一些參考資料或教程。任何內容都將有所幫助

+0

與視圖錨定的彈出窗口! –

+0

https://github.com/shehabic/Droppy –

+0

@NaveenTamrakar我在這裏尋找不同的東西,我可以做他們已經做的方式,但我希望列表中的每個元素表現爲一個微調器 –

回答

0

您可以使用Dialog來做到這一點,當您單擊filter_box時,它會顯示出來。 只需創建類MyDialog extends Dialog並將您的xml佈局放置到您需要「彈出」顯示的位置。

+0

請給我一些更多的信息,我無法遵循 –

0

您可以將自定義佈局膨脹到彈出窗口。

LayoutInflater layoutInflater = (LayoutInflater)getBaseContext(.getSystemService(LAYOUT_INFLATER_SERVICE); 
    View popupView = layoutInflater.inflate(R.layout.popup, null); 
    final PopupWindow popupWindow = new PopupWindow(popupView,400,400); 

popupWindow.showAtLocation(attachment_button, Gravity.CENTER, 10, 200); 

在佈局中進行自定義列表視圖。

相關問題