最近在做一个跑步的APP,需要用到百度地图的SDK。然后在写UI布局的时候需要在地图上面浮动显示控件按钮。
用了很多方法,也不如意,最后发现原来直接用RelativeLayout就可以做出这种效果。
代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<com.baidu.mapapi.map.TextureMapView
android:id="@+id/bmapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"/>
<Button
android:layout_width="70dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="30dp"
android:background="@mipmap/bt_icon_location"
/>
</RelativeLayout>
本文介绍如何在使用百度地图SDK开发跑步应用时,在地图上浮动显示控件按钮的方法。通过RelativeLayout布局实现按钮定位,方便调整位置。

3187

被折叠的 条评论
为什么被折叠?



