最近没事做就写了一下PopupWindow,希望对有些人有点帮助。
照常先看一下完成后的结果(界面比较难看就不要吐槽了)
点击地理位置然后弹出的PopupWindow,数据我写死了但是可以根据你们的需求自己改,或者通过网络获取数据。我是通过listView进行展示的你们也可以改成表格布局,具体的实现代码如下:
PopupWindow的弹出框的整体布局(listView)fragment_popup:
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/pop_path"
android:layout_width="match_parent"
android:layout_height="wrap_content">
listview要加载的item:pop_list_adapter.xml
<