我想顯示的最初加載從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 =「@繪製/佔位符」'''使它看起來靜態..因此,我想顯示一個進度條:)任何其他想法? –