2016-06-02 5 views

Antwort

0

erstellen Layout wie dies in Ihrem Adapter:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
      > 

    <ImageView 
     android:id="@+id/simpleImage" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     /> 

     <RelativeLayout 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      visibility="gone"> 
      <ImageView 
       android:id="@+id/simpleImageWithNumber" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       /> 
      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerInParent="true" 
       android:text="+5"/> 
     </RelativeLayout> 
</RelativeLayout> 

In ViewHolder diese beiden Bilder zu initialisieren.

Und in onBindViewHolder() die Position überprüfen, wenn es 4 dann simpleImageWithNumber ist laden sonst Simple laden.

Verwandte Themen