Andorid Map布局 可添加自定义控件

来源:互联网 发布:模拟画像软件 编辑:程序博客网 时间:2024/05/16 17:10

布局运用了绝对布局的方式,如下

<?xml version="1.0" encoding="utf-8"?><AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical" >    <com.google.android.maps.MapView         android:id="@+id/mv"        android:clickable="true"        android:enabled="true"        android:layout_width="match_parent"        android:layout_height="match_parent"        android:apiKey="0RAabqk4Sv25aZe8mzF_UN1tS4WrydOuIZBy7fA" />    <Button         android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:id="@+id/navigation"        android:text="导航"        android:layout_x="20dip"        android:layout_y="20dip"/></AbsoluteLayout>

在地图上添加了一个导航按钮,效果如下:


通过该方法,通过调整布局和运用图片等方法,可以定义出更美观的布局


原创粉丝点击