Android 如何使FlexboxLayout滚动?
我在我的一项活动中使用了Android FlexboxLayout,但当内容大于我的屏幕时,我无法在那里滚动查看它。所有的例子似乎都是默认的,但在我的代码中却没有这样做 XML如下所示:Android 如何使FlexboxLayout滚动?,android,android-flexboxlayout,Android,Android Flexboxlayout,我在我的一项活动中使用了Android FlexboxLayout,但当内容大于我的屏幕时,我无法在那里滚动查看它。所有的例子似乎都是默认的,但在我的代码中却没有这样做 XML如下所示: <?xml version="1.0" encoding="utf-8"?> <com.google.android.flexbox.FlexboxLayout android:id="@+id/fbRoot" xmlns:android="http://schemas.and
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/fbRoot"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:alignContent="flex_start"
app:alignItems="stretch"
app:flexWrap="wrap">
.. a lot of other views ..
</com.google.android.flexbox.FlexboxLayout>
.. 还有很多其他的观点。。
像这样将其包裹在
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/fbRoot"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:alignContent="flex_start"
app:alignItems="stretch"
app:flexWrap="wrap">
.. a lot of other views ..
</com.google.android.flexbox.FlexboxLayout>
</ScrollView>
.. 还有很多其他的观点。。
检查此项并