2011-10-19 26 views
2

ギャラリーのウィジェットが遅くて遅れているため、ギャラリーホルダーを使用してビューを再利用しようとしましたが、結果は表示されません。私は古典的な方法代わりにギャラリーウィジェット

public View getView(int position, View convertView, ViewGroup parent) { 


     ViewHolder holder; 
     if (convertView == null) { 
       convertView = mInflater.inflate(R.layout.image, null); 

       // Creates a ViewHolder and store references to the two children views 
       // we want to bind data to. 
       holder = new ViewHolder(); 

       holder.icon = (ImageView) convertView.findViewById(R.id.ImageView01); 

       convertView.setTag(holder); 
     } else { 
       // Get the ViewHolder back to get fast access to the TextView 
       // and the ImageView. 
       holder = (ViewHolder) convertView.getTag(); 
      } 
     holder.icon.setImageDrawable(getPicture(items[position])); 
     return convertView; 

     } 

答えて

-1

これは、他のによって作成され、GitHubにアップロードし、様々なギャラリーのカップルであるを使用していました。あなたはそれらがどのようにどのくらい速いかを見るためにチェックアウトする必要があります。

+0

Androidギャラリーバージョン1.3.1のソースコードはどこからダウンロードできますか? – Vervatovskis

+0

@blessenm - Vervatovskisは、アプリケーションで再利用して、センターロックされた水平スクロールリストにアイテムを表示できるAndroid Gallery widgitを指しています。 http://developer.android.com/reference/android/widget/Gallery.html –

+0

@Vervatovskis - 個々のファイルのコードを参照するには、grepcodeが便利であることがわかります。http://grepcode.com/file/ repository.grepcode.com/java/ext/com.google.android/android/2.3.7_r1/android/widget/Gallery.java#Gallery オープンソースのアンドロイドプロジェクト全体をダウンロードするには、http:// sourceを参照してください。 android.com/source/downloading.html –