Android (嵌套)滚动视图不会滚动到底部
我尝试了很多答案,但我认为我的ScrollView包含了更多的元素 甚至我尝试了嵌套的ScrollView、边距底部、填充,甚至在子布局上使用了android:genderantFocusability=“blocksDescendants”,以及另一个包含ScrollView中所有元素的大型线性布局,但没有结果 问题是我的ScrollView没有滚动到它的 看法我必须说,滚动视图位于水平面下方 将其设定为35%的指导方针可能是 这个称呼 我将插入一个XML代码示例Android (嵌套)滚动视图不会滚动到底部,android,layout,scrollview,vertical-scrolling,Android,Layout,Scrollview,Vertical Scrolling,我尝试了很多答案,但我认为我的ScrollView包含了更多的元素 甚至我尝试了嵌套的ScrollView、边距底部、填充,甚至在子布局上使用了android:genderantFocusability=“blocksDescendants”,以及另一个包含ScrollView中所有元素的大型线性布局,但没有结果 问题是我的ScrollView没有滚动到它的 看法我必须说,滚动视图位于水平面下方 将其设定为35%的指导方针可能是 这个称呼 我将插入一个XML代码示例 <androidx
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.35" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/guideline"
app:layout_constraintVertical_bias="0.0">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:baselineAligned="false"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/linearLayout_dummy1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.1"
android:orientation="horizontal" />
<!-- This is the part that's 85% of the total width.-->
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.9"
android:orientation="vertical">
<LinearLayout
android:id="@+id/linearLayoutInside"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/anotherlayout"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_weight="1"
android:background="@drawable/rounded_shape"
android:baselineAligned="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.26"
android:orientation="horizontal">
....
....
much more linear and constraints layouts that opens then closes
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!--Width 85% ends-->
<LinearLayout
android:id="@+id/linearLayout_dummy2"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight=".1"
android:orientation="horizontal" />
</LinearLayout>
</ScrollView>
您的xml布局中有一些错误。linearlayout的两个关闭标记丢失,您的scrollview应该在Guidence小部件中。它结束了,我只是没有将它们放在那里(在编辑中更新)。xml中没有错误。