我想显示的最初加载从API获取数据之前的骨架图一RecyclerView的图像。在下面的示例中,正在显示一个简单的图像视图和文本。显示占位符在recyclerview
<android.support.v7.widget.CardView
android:id="@+id/cv_store_offer_display"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/img"
android:layout_width="match_parent"
android:layout_height="50dp"
android:scaleType="fitXY"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Foo FOO"/>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
我想知道如何在加载图像/文本之前让我的Recyclerview显示视图。我正在使用毕加索加载图像。用于显示RecyclerView内容的mikepenz FastAdapter。
我还试图用一个进度条为https://stackoverflow.com/a/12342168/371557提及。但即使可见性设置为可见,进度条也不会显示。
你能不能只指定在XML的形象呢? '机器人:SRC =“@绘制/占位符”' – StuStirling
你能证明你的代码中设置图像毕加索.. –
设置'''机器人:SRC =“@绘制/占位符”'''使它看起来静态..因此,我想显示一个进度条:)任何其他想法? –