sina-popmenu - Android高仿新浪微博彈框菜單
sina-popmenu
高仿新浪微博彈框菜單
效果圖如下:
示例代碼
PopMenu popMenu = new PopMenu.Builder().attachToActivity(MainActivity.this) .addMenuItem(new PopMenuItem("文字", getResources().getDrawable(R.drawable.tabbar_compose_idea))) .addMenuItem(new PopMenuItem("照片/視頻", getResources().getDrawable(R.drawable.tabbar_compose_photo))) .addMenuItem(new PopMenuItem("頭條文章", getResources().getDrawable(R.drawable.tabbar_compose_headlines))) .addMenuItem(new PopMenuItem("簽到", getResources().getDrawable(R.drawable.tabbar_compose_lbs))) .addMenuItem(new PopMenuItem("點評", getResources().getDrawable(R.drawable.tabbar_compose_review))) .addMenuItem(new PopMenuItem("更多", getResources().getDrawable(R.drawable.tabbar_compose_more))) .setOnItemClickListener(new PopMenuItemListener() { @Override public void onItemClick(PopMenu popMenu, int position) { Toast.makeText(MainActivity.this, "你點擊了第" + position + "個位置", Toast.LENGTH_SHORT).show(); } }) .build(); popMenu.show();
其他
如果你在使用的過程中遇到問題,請聯系我,謝謝!!!
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!