替代画廊小部件

时间:2011-10-19 08:48:29

标签: android gallery

Android中有没有更快的替代Gallery小部件,因为Gallery太慢而且滞后,我试图使用视图持有者重用视图,但没有结果。我用经典方法

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 个答案:

答案 0 :(得分:-1)

这是由其他人创建的几个不同的画廊,并上传到GitHub。您可能需要签出它们以查看它们的状态和速度。