3
我需要显示谷歌地图的圆形状,如下图所示。
我现在使用的解决方案是这样的:Android谷歌地图圆形
<packagename.views.SquareWidthRelativeLayout
android:id="@+id/map_wrapper"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="@+id/map_fragment"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<RelativeLayout
android:id="@+id/map_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/map_round_border"
android:clickable="true"
android:focusable="true"></RelativeLayout>
</packagename.views.SquareWidthRelativeLayout>
所以其实我只是用绘制圆形PNG相对布局的新层重叠的。此解决方案工作正常,看起来不错。不幸的是,现在我必须在整个布局下显示背景图片。所以我的解决方案在这种情况下不起作用,因为它具有白色背景图像,将叠加在主背景之上。
有没有其他解决方案如何实现这个结果,而不使用可绘制的覆盖层?
你好,谢谢你的建议。不幸的是,我无法将地图片段放入此圆形视图中。如果您有任何提示如何操作,我将非常高兴。 – Sandak 2015-04-08 17:38:54
当然,你可以在这里找到它:https://code.google.com/p/gmaps-api-issues/issues/detail?id=5064。如果你还有一些困难,让我知道。 – KayAnn 2015-04-08 17:48:12
这是嵌套,如果你想详细了解整个概念,请点击这里一直到底部:https://github.com/codepath/android_guides/wiki/Creating-and-Using-Fragments – KayAnn 2015-04-08 17:58:56