12.imageswitcher and Gallery
实现相册浏览要设置这两个,imageswitcher现实大图片 gallery 实现图片带
<ImageSwitcher android:id="@+id/switcher"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
/>
<Gallery android:id="@+id/gallery"
android:background="#55000000"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:gravity="center_vertical"
android:spacing="16dp"
/>
要实现的接口
AdapterView.OnItemSelectedListener gallery, ViewSwitcher.ViewFactory imageswitcher
gallery set adapter ImageAdapter g.setAdapter(new ImageAdapter);
(public class ImageAdapter extends BaseAdapter)
ImageSwitcher唯一实现的方法 makeView()
//imageswitcher建立的不走
mimageswitcher.setFactory(this);
mimageswitcher.setInAnimation(AnimationUtils.loadAnimation(this, android.R.anim.fade_in));
mimageswitcher.setOutAnimation(AnimationUtils.loadAnimation(this, android.R.anim.fade_out));