<ImageSwitcher        android:id="@+id/switcher"              android:layout_width="fill_parent"               android:layout_height="fill_parent"              android:layout_alignParentTop="true"              android:layout_alignParentLeft="true" />   //上面ImageSwitcher是用来显示图片那块区域的控件                  <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" />//Gallery 是来控制低下那个图标列表索引用的  public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);//是使这个Activity没有titleBar,进而这个图片显示区域会增大//下面对BaseAdapter 进行了封装,这里是定义自己的适配器,其中getView()返回要显示的那个ImageView public class ImageAdapter extends BaseAdapter {        public ImageAdapter(Context c) {            mContext = c;        }        public int getCount() {            return mThumbIds.length;        }        public Object getItem(int position) {            return position;        }        public long getItemId(int position) {            return position;        }        public View getView(int position, View convertView, ViewGroup parent) {            ImageView i = new ImageView(mContext); //动态生成一个ImageView            i.setImageResource(mThumbIds[position]);//设置这张图片的源文件            i.setAdjustViewBounds(true);            i.setLayoutParams(new Gallery.LayoutParams(                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));//设置图片框的大小            i.setBackgroundResource(R.drawable.picture_frame);//设置图片的背景            return i;        }        private Context mContext;    }

更多相关文章

  1. 【Android】安卓中常用的图片加载方法
  2. Android 在程序界面上显示图片
  3. ImageVIew 设置图片大小
  4. Android: 背景图片平铺要这么干
  5. Android——Gallery 图片拖动效果
  6. Android ImageView图片自适应
  7. android异步图片加载三之handler+线程池+消息队列模式
  8. Android 图片侧滑展示RecyclerView简单实用
  9. Android 制作.9.png图片之利用Android 9-patch shadow generator

随机推荐

  1. Android中对话框的工具类
  2. Android仿WIN8系统磁贴点击下沉倾斜效果
  3. 使用android 隐藏命令
  4. Android(安卓)解决Could not find com.an
  5. android 单击 切换图片 --- 注意图片大小
  6. 银联手机支付 手机客户端有几个?
  7. 修改android文件系统为可读可写
  8. Android(安卓)Java方法链起来!链式调用方
  9. Android(安卓)RecyclerView网格布局的学
  10. [置顶] Android(安卓)通过经纬度获取地理