close

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 的頭像
    RX1226

    給你魚竿

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