2013-07-02 39 views
0

使用PopupWindow.showAtLocation() http://developer.android.com/reference/android/widget/PopupWindow.html#showAtLocation(android.view.View,INT,INT,INT)Android:如何確保彈出按鈕旁邊出現?

如何使用該功能,以確保彈出窗口總是出現一個按鈕的右邊?

我有以下情形:

摺疊視圖:

enter image description here

擴展視圖:

enter image description here

+0

你現在怎麼做,它是如何顯示與你有代碼? – codeMagic

+0

@codeMagic我正在使用靜態值:mWindow.showAtLocation(anchor,Gravity.CENTER,anchor.getWidth()+ 50,0);問題在於它在摺疊視圖中不起作用,因爲實際發生的情況是菜單向左移動。 –

回答

0

NewQuickAction我可能你需要什麼。

+0

是的,這正是我用過的那個,但是那個按鈕的頂部或底部顯示對話框。 –