首页 > 解决方案 > 相同的 ScrollView 代码在另一个布局中不起作用

问题描述

我开发了一个视频通话应用程序。但在消息屏幕上,我的客户要求回复功能。在开发这个时,我复制了我在另一个布局中运行的 Scrollview 的代码。但是相同的代码在另一个布局中不起作用?

这是我的代码:

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="80dp"
        android:layout_marginStart="10dp"
        android:layout_marginEnd="10dp"
        android:layout_marginBottom="3dp"
        android:animateLayoutChanges="true"
        android:background="@drawable/background_their_message_ll"
        android:orientation="vertical">

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

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/reply_text_view_adapter"
                    android:layout_width="190dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left"
                    android:layout_marginStart="5dp"
                    android:layout_marginRight="6dp"
                    android:text="Reply Message Here"
                    android:textSize="12sp"
                    android:textStyle="italic"
                    tools:ignore="HardcodedText,RtlHardcoded" />
            </LinearLayout>
        </ScrollView>
    </LinearLayout>

我到底哪里错了?

标签: androidscrollview

解决方案


推荐阅读