我想为我的应用程序创建主页。我想在主页的布局中使用scrollview。我尝试在DrawerLayout中添加scrollview,但没有任何帮助。我将scrollview保存在DrawerLayout中的各种位置,但它不起作用。我们怎么做?
activity_main.xml中
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/drawer_layout"
android:fitsSystemWindows="true">
<!--Main content-->
<LinearLayout
android:orientation="vertical"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/app_bar"/>
<ScrollView>
Other layouts and views here!
But it is not working!
</ScrollView>
</LinearLayout>
<!--Navigation Drawer-->
<android.support.design.widget.NavigationView
android:id="@+id/main_drawer"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:headerLayout="@layout/drawer_header"
app:menu="@menu/menu_drawer"/>
</android.support.v4.widget.DrawerLayout>