今天就跟大家聊聊有關(guān)怎么在Android應用中添加一個長按刪除彈功能,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。

只需要調(diào)用該方法即可完成綁定:
PopupList popupList = new PopupList(); popupList.init(context, view, popupMenuItemList, OnPopupListClickListener);
例子:
lv_main = (ListView) findViewById(R.id.lv_main);
mDataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, mDataList);
lv_main.setAdapter(mDataAdapter);
popupMenuItemList.add(getString(R.string.copy));
popupMenuItemList.add(getString(R.string.delete));
popupMenuItemList.add(getString(R.string.share));
popupMenuItemList.add(getString(R.string.more));
PopupList popupList = new PopupList();
popupList.init(this, lv_main, popupMenuItemList, new PopupList.OnPopupListClickListener() {
@Override
public void onPopupListClick(View contextView, int contextPosition, int position) {
Toast.makeText(MainActivity.this, contextPosition + "," + position, Toast.LENGTH_LONG).show();
}
});
ImageView indicator = new ImageView(this);
indicator.setImageResource(R.drawable.popuplist_default_arrow);
popupList.setIndicatorView(indicator);
popupList.setIndicatorSize(dp2px(16), dp2px(8));看完上述內(nèi)容,你們對怎么在Android應用中添加一個長按刪除彈功能有進一步的了解嗎?如果還想了解更多知識或者相關(guān)內(nèi)容,請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。
名稱欄目:怎么在Android應用中添加一個長按刪除彈功能-創(chuàng)新互聯(lián)
網(wǎng)頁路徑:http://www.jbt999.com/article30/eooso.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供商城網(wǎng)站、微信公眾號、網(wǎng)站設計公司、營銷型網(wǎng)站建設、網(wǎng)站建設、品牌網(wǎng)站設計
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:[email protected]。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容