当前位置: 首页 > news >正文

电子商务网站建设体会与收获网页自动点击软件

电子商务网站建设体会与收获,网页自动点击软件,宁夏住房城乡建设厅网站,网站建设项目来源&#xfeff;   Gallery是Android中的图片库控件。先看效果&#xff0c;爽一番 源码下载 一、简介 在中心锁定&#xff0c;水平显示列表的项。 二、实例 1.布局文件 <?xml version"1.0" encoding"utf-8"?><LinearLayout xmlns:android"…

   Gallery是Android中的图片库控件。先看效果,爽一番

 

 源码下载

 一、简介

  在中心锁定,水平显示列表的项。

二、实例

1.布局文件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
   android:orientation="vertical"
  android:layout_height="wrap_content">
 
  <Gallery xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gallery"
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
/>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <Gallery android:id="@+id/gallery1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:spacing="16dp"
    />

</LinearLayout>


</LinearLayout>

 

 2.属性文件

<?xml version="1.0" encoding="utf-8"?>

<resources>

    <declare-styleable name="TogglePrefAttrs">
        <attr name="android:preferenceLayoutChild" />
    </declare-styleable>
   
    <!-- These are the attributes that we want to retrieve from the theme
         in view/Gallery1.java -->
    <declare-styleable name="Gallery1">
        <attr name="android:galleryItemBackground" />
    </declare-styleable>
   
     <declare-styleable name="LabelView">
        <attr name="text" format="string" />
        <attr name="textColor" format="color" />
        <attr name="textSize" format="dimension" />
    </declare-styleable>
</resources>

 

3.代码

/**
 *
 */
package wjq.WidgetDemo;

import android.R.layout;
import android.app.Activity;
import android.content.Context;
import android.content.res.TypedArray;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.Contacts.People;
import android.view.ContextMenu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ContextMenu.ContextMenuInfo;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;
import android.widget.SimpleCursorAdapter;
import android.widget.SpinnerAdapter;
import android.widget.Toast;
import android.widget.AdapterView.AdapterContextMenuInfo;

/**
 * @author 记忆的永恒
 *
 */
public class GalleryDemo extends Activity {
 private Gallery gallery;
 private Gallery gallery1;

 /*
  * (non-Javadoc)
  *
  * @see android.app.Activity#onCreate(android.os.Bundle)
  */
 @Override
 protected void onCreate(Bundle savedInstanceState) {
  // TODO Auto-generated method stub
  super.onCreate(savedInstanceState);
  setContentView(R.layout.gallerypage);
  gallery = (Gallery) findViewById(R.id.gallery);
  gallery.setAdapter(new ImageAdapter(this));
  
  registerForContextMenu(gallery);
  
   Cursor c = getContentResolver().query(People.CONTENT_URI, null, null, null, null);
         startManagingCursor(c);
        
         SpinnerAdapter adapter = new SimpleCursorAdapter(this,
         // Use a template that displays a text view
                 android.R.layout.simple_gallery_item,
                 // Give the cursor to the list adatper
                 c,
                 // Map the NAME column in the people database to...
                 new String[] {People.NAME},
                 // The "text1" view defined in the XML template
                 new int[] { android.R.id.text1 });

         gallery1= (Gallery) findViewById(R.id.gallery1);
         gallery1.setAdapter(adapter);
 }

 @Override
 public void onCreateContextMenu(ContextMenu menu, View v,
   ContextMenuInfo menuInfo) {
  menu.add("Action");
 }

 @Override
 public boolean onContextItemSelected(MenuItem item) {
  AdapterContextMenuInfo info = (AdapterContextMenuInfo) item
    .getMenuInfo();
  Toast.makeText(this, "Longpress: " + info.position, Toast.LENGTH_SHORT)
    .show();
  return true;
 }
 
 public class ImageAdapter extends BaseAdapter {
  int mGalleryItemBackground;
  private Context mContext;

  private Integer[] mImageIds = { R.drawable.b, R.drawable.c,
    R.drawable.d, R.drawable.f, R.drawable.g };

  public ImageAdapter(Context context) {
   mContext = context;

   TypedArray a = obtainStyledAttributes(R.styleable.Gallery1);
   mGalleryItemBackground = a.getResourceId(
     R.styleable.Gallery1_android_galleryItemBackground, 0);
   a.recycle();
  }

  @Override
  public int getCount() {
   return mImageIds.length;
  }

  @Override
  public Object getItem(int position) {
   return position;
  }

  @Override
  public long getItemId(int position) {
   return position;
  }

  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
   ImageView i = new ImageView(mContext);

   i.setImageResource(mImageIds[position]);
   i.setScaleType(ImageView.ScaleType.FIT_XY);
   i.setLayoutParams(new Gallery.LayoutParams(300, 400));

   // The preferred Gallery item background
   i.setBackgroundResource(mGalleryItemBackground);

   return i;
  }

 }


}

 

转载于:https://www.cnblogs.com/salam/archive/2010/10/06/1844564.html

http://www.lbrq.cn/news/2348623.html

相关文章:

  • 最新开公司的基本流程及费用百度seo网站优化 网络服务
  • 烟台学校网站建设企业培训课程设计
  • asp双语网站后台怎么用广州外包网络推广公司
  • 做贸易把产品放到哪个网站好呢成都计算机培训机构排名前十
  • 太仓智能网站开发查询收录
  • 南京一站式工程装饰装修网站每日财经最新消息
  • wordpress框架文件赣州seo排名
  • 做网站时 404网页如何指向国家新闻最新消息今天
  • 品牌营销型网站作用腾讯云服务器
  • 网站界面设计起着决定性作用电脑学校培训
  • 奥特蛋的做网站友链购买有效果吗
  • 长春网站建设 信赖吉网传媒搜索引擎优化技巧
  • vps wordpress 卸载汉中网站seo
  • 网站建设制作方案杭州线上推广
  • wordpress网站上传到服务器品牌运营策略
  • 陕西省住房和城市建设厅网站公众号如何推广引流
  • wordpress读取字体seo高效优化
  • 群晖 wordpress 编辑宁波seo推广服务电话
  • 上饶哪有做网站的公司佛山做网站建设
  • 网站日志分析的意义谷歌账号注册入口官网
  • 电影资源分享网站怎么做的网站权重是怎么提升的
  • 牡丹江市建设局网站中国职业培训在线官网
  • 酷家乐个人网页版网站搜索引擎优化
  • 深圳网站建设易通鼎商品推广
  • 网站建设招标流程图免费刷推广链接的软件
  • 做免费嗳暧视频网站软文发布的平台与板块
  • wordpress文章添加按钮霸榜seo
  • 最火的做牛排沙拉网站seo虚拟外链
  • 最强的网站建设电话seo公司资源
  • 吉安市网站制作关键词推广排名
  • Python 程序设计讲义(2):Python 概述
  • Kafka——生产者消息分区机制原理剖析
  • 【SpringBoot】实战-开发模式及环境搭建
  • 死锁问题以及读写锁和自旋锁介绍【Linux操作系统】
  • 厂区车辆导航系统:基于 GPS+AI 动态路径规划的技术实现与实践
  • 春秋云镜 initial