为什么RecyclerView在android 9中不起作用

问题描述 投票:0回答:1

尽管在android 8及更低版本中一切正常,但我的RecyclerView在android 9中未加载任何东西。

因为我在recyclerView Adapter中使用了毕加索,所以在我的AndroidManifest中添加了以下代码,但未做任何更改:

     android:usesCleartextTraffic="true"

这是我的RecyclerView XML代码,位于MotionLayout中:

<LinearLayout
    android:id="@+id/linearlayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#F6F6F6"
    android:elevation="10dp"
    android:orientation="horizontal">


    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recycler_challenge"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</LinearLayout>

请注意,我的布局中有两个recyclerView,第一个效果很好但是第二个不起作用!

kotlin android-recyclerview android-9.0-pie
1个回答
0
投票

定义一个xml文件,然后将其添加到清单中->> android:networkSecurityConfig =“ @ xml / network_security_config”

© www.soinside.com 2019 - 2024. All rights reserved.