我如何在不向下推 view/widget 的情况下向上滑动(打开)隐藏的 textview/layout?

How would I slide up (open) a hidden textview/layout without pushing a view/widget down?

我有一个应用程序,其中隐藏的线性布局应该打开以显示带有用户信息的文本视图。 open/close 线性布局的按钮位于 phone 屏幕的底部。当我按下按钮时,按钮被强制按下,不可见,以允许隐藏布局。 我想让 UI 做的事情 是当我按下按钮时,隐藏布局会将 UI 内容向上滑动,使按钮留在屏幕上.当我再次单击按钮时,布局将关闭(向下滑动),使 UI 回到原来的位置。

我尝试了其他 Whosebug 链接上提出的许多其他建议,并且在所有情况下,1) 隐藏布局来自 phone 屏幕的页脚或页眉,2)激活隐藏布局的按钮距离隐藏部分足够远,因此无需将隐藏部分放入两个 views/widgets 内,或者 3) 我无法让隐藏布局完全消失(即View.GONE 不会删除布局的顶部部分)。任何人都可以指导我找到一个解决方案来帮助我以这种方式在 UI 上上下滑动吗?下面的代码用于隐藏布局(请参见视觉图像),如果需要查看它们,我有 XML 文件可以滑动 up/down。如果需要任何其他信息,请告诉我。

感谢您的帮助!

[布局滑动打开时隐藏层的图像][1] [1]: https://i.stack.imgur.com/le1Bc.png

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

                <TextView
                    android:id="@+id/hidden_textView_button_results"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/daily_bread_result"
                    android:layout_marginStart="35dp"
                    android:layout_marginEnd="35dp"
                    android:gravity="center"
                    android:paddingTop="100dp"
                    android:paddingBottom="100dp"
                    android:textAlignment="center"
                    android:textSize="32sp"
                    android:textStyle="bold"
                    android:text="Do ya see me?!?"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/cardView_editTexts"
                    app:layout_constraintBottom_toTopOf="@+id/cardView_CalculateDailyBread"/>

            </LinearLayout>

一切都包含在 ScrollView 中,是吗?所以听起来你想让隐藏布局可见,然后立即将隐藏布局的高度添加到ScrollView的滚动位置。

或者您可以完全放弃按钮,并在所有 EditText 都填写完毕后立即显示值。如果他们没有填写,显示一条消息说信息丢失。