在android应用程序中展开底部工作表对话框

在android应用程序中展开底部工作表对话框,android,bottom-sheet,Android,Bottom Sheet,我在底部的一张纸上显示数据,当按下一个按钮屏幕时,它会被调用。但是,工作表上的文本多于屏幕上显示的文本,因此,文本被剪裁。如何修复此问题,使对话框可以从屏幕边缘滚动 我的底部布局xml文件如下所示: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_p

我在底部的一张纸上显示数据,当按下一个按钮屏幕时,它会被调用。但是,工作表上的文本多于屏幕上显示的文本,因此,文本被剪裁。如何修复此问题,使对话框可以从屏幕边缘滚动

我的底部布局xml文件如下所示:

<?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"
android:orientation="vertical">

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical"
    android:text=""
    android:id="@+id/splo"
    />

</LinearLayout>

您可以将
文本视图
放入
滚动视图
中。您的代码应该如下所示:

<?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"
android:orientation="vertical">

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical"
    android:text=""
    android:id="@+id/splo"
    />
</ScrollView>

</LinearLayout>

<?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"
android:orientation="vertical">

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical"
    android:text=""
    android:id="@+id/splo"
    />
</ScrollView>

</LinearLayout>