Android 自定义dailog中的ScrollView正在填充屏幕

Android 自定义dailog中的ScrollView正在填充屏幕,android,android-layout,android-scrollview,Android,Android Layout,Android Scrollview,我遇到了一个问题,如何为我的两个文本视图峰值和峰值索引适当设置我的scorl视图。基本上,他们是填写我所有的自定义日志,而不是显示删除按钮和取消按钮。我希望在峰值和峰值_索引处显示我的结果的滚动视图,但滚动视图会影响两个按钮,而不会显示在对话框上。在这种情况下我该怎么办?此外,峰值占用了对话框中的大量空间。为什么 这是因为scrollview高度是匹配父级的,它应该是wrap\u content或0或固定值 先生,我似乎不明白您的意思,请您再向我解释一下,对不起,我也不认为您的xml是完整的

我遇到了一个问题,如何为我的两个文本视图峰值峰值索引适当设置我的scorl视图。基本上,他们是填写我所有的自定义日志,而不是显示删除按钮和取消按钮。我希望在峰值峰值_索引处显示我的结果的滚动视图,但滚动视图会影响两个按钮,而不会显示在对话框上。在这种情况下我该怎么办?此外,峰值占用了对话框中的大量空间。为什么



这是因为scrollview高度是匹配父级的,它应该是wrap\u content或0或固定值

先生,我似乎不明白您的意思,请您再向我解释一下,对不起,我也不认为您的xml是完整的,scrollview的结束标记在哪里?请查看我对话框的图片。“删除”和“取消”两个按钮未显示在我的自定义布局中。我想知道为什么。当我把ScrollView放在两个TextView上,让我的值都滚动时,问题就出现了,因为它们都很多。对不起,广告里面的东西。先生,这就是您的xml是这样编辑的吗?如果是,请你发布整个xml,我认为它不正确你的xml,如果我错了请纠正我peak_Num和text_Index都是我在这里显示的值。我设置了ScrollView,以便在最终滚动时可以看到我的两个按钮。但我的实现是错误的。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/back"
android:orientation="vertical">

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="#2196F3"
    android:orientation="horizontal">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:background="@drawable/back"
        android:text="Peaks in KPa"
        android:textColor="#040307" />

    <TextView

        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:background="@drawable/back"
        android:text="time in sec."
        android:textColor="#040307" />

</LinearLayout>

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#2196F3"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/Peak_Num"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@drawable/back"
            android:text="Peaks"
            android:textColor="#040307" />

        <TextView
            android:id="@+id/text_Index"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="right"
            android:layout_weight="1"
            android:background="@drawable/back"
            android:text="@string/Peaks_index"
            android:textColor="#040307" />

    </LinearLayout>

</ScrollView>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"

        android:padding="3dp">

        <Button
            android:id="@+id/button_Del"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="1dp"
            android:layout_weight="1"
            android:background="@drawable/button"

            android:text="Delete File" />

        <Button
            android:id="@+id/button_Cancel"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="1dp"
            android:layout_weight="1"
            android:background="@drawable/button"
            android:text="Cancel" />

    </LinearLayout>