ScrollView固定的滚动高度

时间:2020-03-23 22:10:10

标签: java scrollview android-studio-3.6.1

我在我的android项目中使用 ScrollView 。在 ScrollView 中,我使用了两个 ExpandableCardView 。就在 ScrollView strong>我正在使用两个 ExtendedFAB 按钮。下面是布局的图片。

enter image description here

我希望布局像展开订单分析动机分析或两者时一样,按钮应随着边框容器的高度增加而沿底部移动但按钮不应从底部转义以变为一半可见。我希望在这种情况下,当两个 Button 到达底部时,会受到 Bordered container 高度的延长的影响由于扩展 订单分析动机分析,此时 Bordered容器中的内容应会滚动。我不希望由于扩展 Bordered容器而使按钮从底部转义。我找不到任何解决方案。

这是我的 xml < / strong>文件

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".Fragment.WorkerAnalyticsFragment"
    android:background="@color/uniform_background">

    <LinearLayout
        android:id="@+id/profile_container"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="@dimen/profile_container_margin_top">

        <de.hdodenhof.circleimageview.CircleImageView
            android:id="@+id/circle_image_view_large"
            android:layout_width="@dimen/circle_image_view_large_width"
            android:layout_height="@dimen/circle_image_view_large_height"
            android:src="@drawable/example_avatar"
            android:layout_gravity="center_horizontal"/>

        <androidx.appcompat.widget.AppCompatTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/text_view_profile_name"
            android:maxLines="1"
            android:layout_gravity="center_horizontal"
            style="@style/UniformTextAppearance"/>

    </LinearLayout>

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

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

            <LinearLayout
                android:id="@+id/analytics_container"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_margin="@dimen/analytics_container_margin"
                android:orientation="vertical"
                android:padding="@dimen/analytics_container_padding"
                android:background="@drawable/container_background">

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

                    <TextView
                        android:id="@+id/text_view_current_order_status_text"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="@string/text_view_current_order_status_text"
                        android:textStyle="bold"
                        style="@style/UniformTextAppearance"/>

                    <com.kofigyan.stateprogressbar.StateProgressBar
                        android:id="@+id/your_state_progress_bar_id"
                        android:layout_marginTop="@dimen/step_view_margin_top"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        app:spb_maxStateNumber="four"
                        app:spb_stateDescriptionSize="@dimen/sbp_state_description_text_size"
                        app:spb_maxDescriptionLines="1"
                        app:spb_stateBackgroundColor="@color/spb_state_background_color"
                        app:spb_stateForegroundColor="@color/spb_state_foreground_color"

                app:spb_descriptionTopSpaceIncrementer="@dimen/spb_description_top_Space_incrementer"
                    app:spb_currentStateDescriptionColor="@color/spb_current_state_description_color"
                    app:spb_stateDescriptionColor="@color/spb_state_description_color"
                    app:spb_stateNumberBackgroundColor="@color/spb_state_number_background_color"/>

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/profile_analytics_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:layout_marginTop="@dimen/profile_container_margin_top">

                    <TextView
                        android:id="@+id/text_view_worker_analytics"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="@string/text_view_worker_analytics_text"
                        android:textStyle="bold"
                        style="@style/UniformTextAppearance"/>

                    <include layout="@layout/card_view_analytics_container"/>

                </LinearLayout>

            </LinearLayout>

        </ScrollView>

    </FrameLayout>

    <include layout="@layout/order_and_report_buttons" />

</LinearLayout>

0 个答案:

没有答案