今天就跟大家聊聊有關(guān)怎么在Android應(yīng)用中添加一個(gè)長(zhǎng)按刪除彈功能,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(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)容,你們對(duì)怎么在Android應(yīng)用中添加一個(gè)長(zhǎng)按刪除彈功能有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。
名稱欄目:怎么在Android應(yīng)用中添加一個(gè)長(zhǎng)按刪除彈功能-創(chuàng)新互聯(lián)
網(wǎng)頁(yè)路徑:http://chinadenli.net/article30/eooso.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供商城網(wǎng)站、微信公眾號(hào)、網(wǎng)站設(shè)計(jì)公司、營(yíng)銷型網(wǎng)站建設(shè)、網(wǎng)站建設(shè)、品牌網(wǎng)站設(shè)計(jì)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容