Gallery
来源:互联网 发布:意大利语发音规则 知乎 编辑:程序博客网 时间:2024/05/11 04:47
<ImageSwitcher android:id="@+id/switcher"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Gallery android:id="@+id/gallery"
android:background="#55000000"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:gravity="center_vertical"
android:spacing="16dp" />
Gallery gallery=(Gallery)findViewById(R.id.gallery);
gallery.setAdapter(new ImageAdapter(this));
public class ImageAdapter extends BaseAdapter
{
private Context myContext;
private int [] myImageIds=
{
android.R.drawable.btn_minus,
android.R.drawable.btn_radio,
android.R.drawable.ic_lock_idle_low_battery,
android.R.drawable.ic_menu_camera
};
public ImageAdapter(Context c){this.myContext=c;}
public int getCount(){return this.myImageIds.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(this.myContext);
i.setScaleType(ImageView.ScaleType.FIT_XY);
i.setLayoutParams(new Gallery.LayoutParams(120,120));
return i;
}
public float getScale(boolean focused,int offset)
{
return Math.max(0,1.0f/(float)Math.pow(2,Math.abs(offset)));
}
}
- Gallery
- Gallery
- Gallery
- gallery
- gallery
- Gallery
- gallery
- Gallery
- Gallery
- Gallery
- Gallery
- Gallery
- Gallery
- gallery
- gallery
- Gallery
- Gallery
- gallery
- 看完就能开车了
- UTF-8编码网站空白问题,PHP验证码不显示问题
- PHP - Iterator接口的解释
- 关于计划成本的思考
- phplist概述 phplist简介
- Gallery
- asp.net中Server.Transfer和Response.Redirect的区别
- dos批处理知识
- momofetion v1.0发布
- Android手机快捷键大全
- 怎样卸载 WebSphere Application server
- OpenSuSE下使用的ssh
- C中内存和指针的运用
- linux wine-qq介绍2009版QQ精简