0

Google지도 앱의 아래 이미지와 같이 mapView에 listView를 표시하고 싶습니다.lisView를 mapView에 표시합니다.

처음에는지도 만 표시됩니다. 사용자가 탭을 클릭하면이 listView가 mapView에 표시됩니다.

enter image description here

는 그러나 문제는 레이아웃을 아래에 사용하는 것은 (회색 화면이 표시되는)지도를 표시하지 않습니다. 그러나 listView이 표시됩니다.

레이아웃 : 설정하는

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/pickMatchesLayout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <TabHost 
     android:id="@+id/tabHost" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" > 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:orientation="vertical" > 

      <TabWidget 
       android:id="@android:id/tabs" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" > 
      </TabWidget> 

      <FrameLayout 
       android:id="@android:id/tabcontent" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" > 

       <RelativeLayout 
        android:id="@+id/map_layout" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" > 

        <fragment 
         android:id="@+id/map" 
         android:name="com.google.android.gms.maps.MapFragment" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" /> 

        <include layout="@layout/listView" > 
        </include> 
       </RelativeLayout> 
      </FrameLayout> 
     </LinearLayout> 
    </TabHost> 

</RelativeLayout> 

방법 탭 : 탭의

// Set up tabs 
private void setUpTabs() { 

    // Get TabHost 
    tabHost = (TabHost) findViewById(R.id.tabHost); 
    tabHost.setup(); 

    // Create tabs 
    TabSpec sourceOnlyState = tabHost.newTabSpec(SOURCE_ONLY_STATE); 
    sourceOnlyState.setContent(R.id.map); 
    sourceOnlyState.setIndicator("Source Only"); 

    TabSpec allState = tabHost.newTabSpec(ALL_STATE); 
    allState.setContent(R.id.map); 
    allState.setIndicator("All"); 

    TabSpec mapTypes = tabHost.newTabSpec(MAP_FEATURES); 
    mapTypes.setContent(R.id.map_layout); 
    mapTypes.setIndicator("Map Types"); 

    // Add tabs in TabHost 
    tabHost.addTab(sourceOnlyState); 
    tabHost.addTab(allState); 
    tabHost.addTab(mapTypes); 

    // Set tab change listener 
    tabHost.setOnTabChangedListener(this); 
} 

답변

0

의 OnClick 새로운 활동을 시작하고 모든 그 활동 목록보기 관련 코드와 설정 테마를 할 활동은

android:theme="@android:style/Theme.Holo.Dialog.NoActionBar" 
+0

각 탭마다 별도의 활동이 없으며 개별 활동도 필요하지 않습니다. – Geek