實(shí)現(xiàn)目標(biāo)
先來一張微信功能截圖看看要做什么
其實(shí)就是有一個(gè)目的地,點(diǎn)擊目的地的時(shí)候彈出可選擇的應(yīng)用進(jìn)行導(dǎo)航。
大腦動(dòng)一下,要實(shí)現(xiàn)這個(gè)功能應(yīng)該大體分成兩步:
底部菜單這里用PopupWindow來做。
實(shí)現(xiàn)
1、菜單顯示
PopupWindow支持傳入view進(jìn)行彈出展示,所有我們直接寫一個(gè)菜單布局,高德、百度、騰訊 再加一個(gè)取消。
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>
網(wǎng)站欄目:Android仿微信調(diào)用第三方地圖應(yīng)用導(dǎo)航(高德、百度、騰訊)-創(chuàng)新互聯(lián)
網(wǎng)站路徑:http://m.rwnh.cn/article46/cedhhg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站制作、電子商務(wù)、虛擬主機(jī)、用戶體驗(yàn)、域名注冊(cè)、微信小程序
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容