【发布时间】:2019-02-13 18:52:34
【问题描述】:
我正在尝试编写一个使用以下布局的简单 MapActivity(目前仅包含地图视图,因为我计划将来添加与 ListView 共享屏幕):
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="200dip"
android:enabled="true"
android:clickable="true"
android:apiKey="mykey"
android:layout_alignParentBottom="true" />
</RelativeLayout>
我为地图视图应用了一个简单的形状,以便有圆角和笔触:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp"/>
<stroke android:width="3dp"
android:color="@color/bordure_tables" />
</shape>
我使用以下方法来应用形状:
mapView.setBackgroundResource(R.layout.map);
问题是它没有任何效果,我看不到我的圆角,也看不到笔划。
【问题讨论】:
-
同样的问题!请帮助我们。
标签: android android-mapview rounded-corners