Android 앱을 개발 중이며 탐색 서랍이 있습니다. 내 질문은 오히려 모든 페이지에 같은 코드를 작성하는 것입니다 (나는 조각이 아닌 액티비티를 사용하기 때문에) 레이아웃 파일의 어딘가에 다른 파일에 포함시켜야합니다. 마찬가지로 :레이아웃 파일에 android.support.design.widget.NavigationView 포함
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_gravity="start"
app:headerLayout="@layout/nav_header"
app:menu="@menu/drawer_view"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/tools" />
이 BTW는 레이아웃의 높이와 너비를 정의하는 오류를 보여줍니다 이 같은 탐색 모음의 레이아웃 파일이 있습니다.
그리고 난 같은 다른 레이아웃 파일에 동일한 포함해야
<include layout="@layout/navigation_view" />
어떻게 그렇게?