实现目标
先来一张微信功能截图看看要做什么
其实就是有一个目的地,点击目的地的时候弹出可选择的应用进行导航。
大脑动一下,要实现这个功能应该大体分成两步:
底部菜单这里用PopupWindow来做。
实现
1、菜单显示
PopupWindow支持传入view进行弹出展示,所有我们直接写一个菜单布局,高德、百度、腾讯 再加一个取消。
map_navagation_sheet.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <Button android:id="@+id/baidu_btn" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/ulz_white_selector" android:text="百度地图"/> <include layout="@layout/common_line_view"/> <Button android:id="@+id/gaode_btn" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/ulz_white_selector" android:text="高德地图"/> <include layout="@layout/common_line_view"/> <Button android:id="@+id/tencent_btn" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/ulz_white_selector" android:text="腾讯地图"/> <include layout="@layout/common_line_view"/> <Button android:id="@+id/cancel_btn2" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/ulz_white_selector" android:text="取消"/> </LinearLayout>
网站栏目:Android仿微信调用第三方地图应用导航(高德、百度、腾讯)-创新互联
网站路径:https://www.cdcxhl.com/article46/cedhhg.html
成都网站建设公司_创新互联,为您提供品牌网站制作、电子商务、虚拟主机、用户体验、域名注册、微信小程序
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联