2011-10-14 89 views

回答

-1

使用形状绘制使用下面的形状可绘制编码片段

<?xml version="1.0" encoding="utf-8"?> 
<shape 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="rectangle"> 
    <solid android:color="#ffffffff"> 
    </solid> 
    <corners android:topLeftRadius="10dip" android:topRightRadius="10dip" android:bottomLeftRadius="10dip" android:bottomRightRadius="10dip"> 
    </corners> 

</shape> 

更多访问下面的链接。

http://developer.android.com/guide/topics/resources/drawable-resource.html

cheeers ...

+1

感谢您的答复,但我已经尝试过这一点,并没有为我工作了。地图视图覆盖了弯曲的边缘。 – Rajapandian

+0

将您的mapview放置在任何布局中,然后将该布局设置为可在背景上绘制,所以实际上布局(线性,相对等)将具有圆角,这可能需要。 –

0

所以,我已经实现了通过做以下这个影响:我创建了一个9补丁绘制所谓round_corners并把它放在我的绘制文件夹,然后我用以下XML来绘制地图:

<FrameLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent">/ 

     <com.google.android.maps.MapView 
      android:id="@+id/center_map" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:clickable="true" 
      android:apiKey="your_key" 
     /> 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:orientation="vertical" 
      android:background="@drawable/round_corners" 
     ></LinearLayout> 
    </FrameLayout> 
3

只是写了一个教程,有它的程序做了MapView的圆角所以应该很好地扩展到所有设备:

http://www.anddev.org/novice-tutorials-f8/rounded-corners-map-view-t56908.html

一旦你加入,你可以只是实例化一个圆形的MapView像这样的自定义视图类:

<com.blundell.tut.ui.widget.RoundedMapView 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"/> 
+0

是啊这一个为我工作 http://blog.blundell-apps.com/rounded-corners-mapview/ –

相关问题