Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/182.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 滚动视图';s滚动条在底部工作不正常?_Android_Bottom Sheet_Android Nestedscrollview - Fatal编程技术网

Android 滚动视图';s滚动条在底部工作不正常?

Android 滚动视图';s滚动条在底部工作不正常?,android,bottom-sheet,android-nestedscrollview,Android,Bottom Sheet,Android Nestedscrollview,我在NestedScrollView中放置了一个编辑文本,以便可以展开编辑文本。但问题是NestedScrollView放置在底部工作表中,这就是为什么不滚动滚动视图的原因。 我想知道如何使NestedScrollView滚动 我的代码: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:app="http://schemas.androi

我在
NestedScrollView
中放置了一个编辑文本,以便可以展开编辑文本。但问题是
NestedScrollView
放置在
底部工作表中,这就是为什么不滚动滚动视图的原因。
我想知道如何使
NestedScrollView
滚动

我的代码:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:id="@+id/relBot"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:layout_behavior="@string/bottom_sheet_behavior"
android:background="#fff"
android:orientation="vertical">
<View
    android:id="@+id/hBot"
    android:layout_width="match_parent"
    android:layout_height="44dp"
    android:background="@drawable/shadow"
    />
<TextView
    android:id="@+id/headingBot"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:text="Comments"
    android:textColor="#fff"
    android:layout_marginTop="2dp"
    android:textSize="25sp"
    android:textStyle="bold"
    android:fontFamily="sans-serif-condensed"
    />
<ImageView
    android:id="@+id/back_of_bot"
    android:layout_width="30dp"
    android:layout_height="30dp"
    android:layout_marginTop="5dp"
    android:tint="#fff"
    android:clickable="true"
    android:src="@drawable/ic_arrow_left_black_48dp" />

<android.support.v7.widget.RecyclerView
 android:id="@+id/botRView"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:layout_marginTop="10dp"
 android:layout_below="@+id/hBot"
 android:layout_above="@+id/linLayCommi"/>
<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/linLayCommi"
    android:clickable="true"
    android:focusable="true"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    android:layout_alignParentBottom="true">
<android.support.v7.widget.CardView
 android:layout_width="match_parent"
 android:layout_height="50dp"
 app:cardBackgroundColor="#efeeee"
 android:orientation="vertical">
<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginRight="40dp"
    android:layout_marginEnd="40dp"
    android:imeOptions="actionDone"
    android:hint="Write a Comment..."
    app:backgroundTint="#efeeee"/>
 <LinearLayout
     android:layout_width="40dp"
     android:layout_height="match_parent"
     android:layout_gravity="end"
     android:clickable="true"
     android:gravity="center"
     android:background="#001919">

     <ImageView
         android:layout_width="30dp"
         android:layout_height="25dp"
         android:tint="#fff"
         app:srcCompat="@drawable/emoji_1f58b" />
 </LinearLayout>
</android.support.v7.widget.CardView>
</android.support.v4.widget.NestedScrollView>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>

经过大量研究,我最终解决了我的问题,将scrollview放置在trasperent线性布局中,因为我们无法在xml中设置任何视图的最大高度,现在它正在滚动。 参考:

尝试以下解决方案:

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:id="@+id/layout_form"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

        <!-- elements-->
        <!-- elements-->

        </LinearLayout>

    </androidx.core.widget.NestedScrollView>