floating context menu就是設定長按某個view之後

會彈出menu選單

介紹如下

 

1. 官網http://developer.android.com/guide/topics/ui/menus.html#groups

01.png

 

2. 使用時指要在指定的view上registerForContextMenu(目標View)

02.png

 

3. 然後在onCreateContextMenu內inflater該view

在onContextItemSelected內寫其callback

03.png

 

4. 就可以在長按目標view後跳出menu了

04.png  

arrow
arrow
    文章標籤
    Android floating context menu
    全站熱搜

    RX1226 發表在 痞客邦 留言(0) 人氣()