2014-03-13 3 views
0

버튼을 누르면지도 조각을 확대 할 수 있습니다. 이전에는이 ​​코드를 사용했습니다.버튼을 누르면지도 조각이 확대됩니다.

Google지도 v1에서는 정상적으로 작동했지만 V2에서는 더 이상 컴파일되지 않습니다.

이것을 달성하는 V2 방법은 무엇입니까?

XML with fragment: 
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/mainmtc" android:layout_width="fill_parent" 
android:layout_height="fill_parent" android:weightSum="1" 
android:orientation="vertical"> 
<RelativeLayout 
android:id="@+id/dontcare" 
android:layout_width="fill_parent" 
android:layout_height="match_parent" > 
<fragment 
    android:id="@+id/map" 
    android:layout_width="match_parent" 
    android:layout_height="fill_parent" 
    android:layout_below="@id/maindesc" 
    class="com.google.android.gms.maps.MapFragment" /> 
+0

이렇게하면됩니다. –

+0

아니요, GoogleMap 형식에 대해 setLayoutParams (RelativeLayout.LayoutParams) 메서드가 정의되지 않았습니다. – michaelsmith

+0

오류가 발생합니까? 그렇다면 스택 추적을 게시하십시오. –

답변

0

다음 코드를 업데이트하십시오.

<fragment 
android:id="@+id/map" 
android:layout_width="match_parent" 
android:layout_height="fill_parent" 
android:layout_below="@id/maindesc" 
class="com.google.android.gms.maps.SupportMapFragment" /> 

이렇게하면 오류를 제거하는 데 도움이됩니다. 호프 희망.

+0

이 작동하지 않습니다. 컴파일 오류 얻기 SupportMapFragment를 – michaelsmith

+0

유형으로 해석 할 수 없습니다. 맵 조각이 포함 된 xml을 보여주세요. –

+0

XML이 질문에 추가되었습니다. – michaelsmith

관련 문제