Issue
I have one of the new MapFragment
s in a ScrollView
. Actually it's a SupportMapFragment
, but anyway. It works, but there are two problems:
When scrolled, it leaves a black mask behind. The black covers exactly the area where the map was, except for a hole where the +/- zoom buttons were. See screenshot below. This is on Android 4.0.
The view doesn't use
requestDisallowInterceptTouchEvent()
when the user interacts with the map to prevent theScrollView
intercepting touches, so if you try to pan vertically in the map, it just scrolls the containingScrollView
. I could theoretically derive a view classMapView
and add that functionality, but how can I getMapFragment
to use my customisedMapView
instead of the standard one?
Solution
Applying a transparent image over the mapview fragment seems to resolve the issue. It's not the prettiest, but it seems to work. Here's an XML snippet that shows this:
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="300dp" >
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<ImageView
android:id="@+id/imageView123"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/temp_transparent" />
</RelativeLayout>
Answered By - walnut_head
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.