带有工具提示箭头的Android PopupWindow
我已经通过传递null或新的Drawable()到setBackgroundDrawable()来看到很多关于删除PopupWindow边框的问题。 我有相反的问题。 我想要一个围绕我的PopupWindow的边框,最好是一个指向我的锚的工具提示箭头。 目前,我的PopupWindow没有边界。 我已经尝试调整边距,XML中的背景,布局,列表视图和列表视图行的宽度和高度无济于事。 有人可以帮助我得到一个边界和图像的顶部? 我试图用这个坚持android SDK。
popup_menu_list.xml
Java的
private void displayPopupMenu() { LayoutInflater layoutInflater = getLayoutInflater(); View popupView = layoutInflater.inflate(R.layout.popup_menu_list, null); final PopupWindow popupWindow = new PopupWindow(popupView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); RefreshListView myListView = (RefreshListView) popupView.findViewById(R.id.popup_menu_list_listview); mAdapter = new myAdapter(this, getAdapterData()); myListView.setAdapter(mAdapter); popupWindow.showAsDropDown(mMyAnchor); }
我只是抓住这些作为例子,但我想这样的popup点指向锚点的东西: