2016-09-01 4 views
-2

툴바와 Google지도 조각이있는 AppCompatActivity가 있습니다. 이는 다음과 같이 XML 형식으로 이루어집니다.조각 내부의 도구 모음이 겹침 조각

<?xml version="1.0" encoding="utf-8"?> 
<fragment 
class="com.google.android.gms.maps.SupportMapFragment" 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:id="@+id/map" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
app:layout_behavior="@string/appbar_scrolling_view_behavior"> 

<android.support.v7.widget.Toolbar 
    android:id="@+id/toolbarFindRoutes" 
    android:layout_width="match_parent" 
    android:layout_height="?attr/actionBarSize" 
    android:background="?attr/colorPrimary" 
    android:elevation="4dp" 
    android:theme="@style/AppTheme.AppBarOverlay" 
    app:popupTheme="@style/AppTheme.PopupOverlay"/> 


</fragment> 

그러나 내 도구 모음은 내 조각보기 위에 있습니다. 나는 도구 모음 아래에 조각을 갖고 싶지만, 이해할 수 있도록 XML에서 루트 요소로 조각을 가져야합니다. 이것은 예를 들어 가질 수 없다는 것을 의미합니다. RelativeLayout을 루트로 사용하고 툴바 아래에있는 단편을 선언하면됩니다.

+0

아래로 레이아웃을 변경

. –

답변

1
당신은 내`프레임 Layout` 넣어해야
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:orientation="vertical"> 
    <android.support.v7.widget.Toolbar 
     android:id="@+id/toolbarFindRoutes" 
     app:popupTheme="@style/AppTheme.PopupOverlay" 
     android:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     android:background="?attr/colorPrimary" 
     android:elevation="4dp" 
     android:theme="@style/AppTheme.AppBarOverlay" /> 

    <fragment xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:app="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/map" 
     class="com.robo.movie.movieapp.Movies.ui.MovieListFragment" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior"/> 

</LinearLayout>