android 广告栏效果,实现android广告栏效果

public classBannerLayout extendsRelativeLayout {

privateViewPager mViewPager; // 轮播容器// 指示器(圆点)容器privateLinearLayout indicatorContainer;

privateDrawable unSelectedDrawable;

privateDrawable selectedDrawable;

private intWHAT_AUTO_PLAY= 1000;

private booleanisAutoPlay= true; // 自动轮播private intitemCount;

private intselectedIndicatorColor= 0xffff0000;

private intunSelectedIndicatorColor= 0x88888888;

private inttitleBGColor= 0X33000000;

private inttitleColor= 0Xffffffff;

privateShape indicatorShape= Shape.oval;

private intselectedIndicatorHeight= 20;

private intselectedIndecatorWidth= 20;

private intunSelectedIndicatorHeight= 20;

private intunSelectedIndecatorWidth= 20;

private intautoPlayDuration= 4000;

private intscrollDuration= 900;

// 指示器中点和点之间的距离private intindicatorSpace= 15;

// 指示器整体的设置private intindicatorMargin= 20;

private static final inttitlePadding= 20;

private intdefaultImage;

private enumShape {

// 矩形 或 圆形的指示器rect, oval}

privateOnBannerItemClickListener mOnBannerItemClickListener;

privateHandler mHandler= newHandler(newHandler.Callback() {

@Overridepublic booleanhandleMessage(Message msg) {

if(msg.what== WHAT_AUTO_PLAY) {

if(mViewPager!= null) {

mViewPager.setCurrentItem(mViewPager.getCurrentItem() + 1, true);

mHandler.sendEmptyMessageDelayed(WHAT_AUTO_PLAY, autoPlayDuration);

}

}

return false;

}

});

publicBannerLayout(Context context) {

super(context);

init(null, 0);

}

publicBannerLayout(Context context, AttributeSet attrs) {

super(context, attrs);

init(attrs, 0);

}

publicBannerLayout(Context context, AttributeSet attrs, intdefStyleAttr) {

super(context, attrs, defStyleAttr);

init(attrs, defStyleAttr);

}

private voidinit(AttributeSet attrs, intdefStyleAttr) {

TypedArray array = getContext().obtainStyledAttributes(attrs, R.styleable.BannerLayoutStyle, defStyleAttr, 0);

selectedIndicatorColor= array.getColor(R.styleable.BannerLayoutStyle_selectedIndicatorColor, selectedIndicatorColor);

unSelectedIndicatorColor= array.getColor(R.styleable.BannerLayoutStyle_unSelectedIndicatorColor, unSelectedIndicatorColor);

titleBGColor= array.getColor(R.styleable.BannerLayoutStyle_titleBGColor, titleBGColor);

titleColor= array.getColor(R.styleable.BannerLayoutStyle_titleColor, titleColor);

intshape = array.getInt(R.styleable.BannerLayoutStyle_indicatorShape, Shape.oval.ordinal());

for(Shape shape1 : Shape.values()) {

if(shape1.ordinal() == shape) {

indicatorShape= shape1;

break;

}

}

selectedIndecatorWidth= (int) array.getDimension(R.styleable.BannerLayoutStyle_selectedIndicatorWidth, selectedIndecatorWidth);

selectedIndicatorHeight= (int) array.getDimension(R.styleable.BannerLayoutStyle_selectedIndicatorHeight, selectedIndicatorHeight);

unSelectedIndecatorWidth= (int) array.getDimension(R.styleable.BannerLayoutStyle_unSelectedIndicatorWidth, unSelectedIndecatorWidth);

unSelectedIndicatorHeight= (int) array.getDimension(R.styleable.BannerLayoutStyle_unSelectedIndicatorHeight, unSelectedIndicatorHeight);

indicatorSpace= (int) array.getDimension(R.styleable.BannerLayoutStyle_indicatorSpace, indicatorSpace);

indicatorMargin= (int) array.getDimension(R.styleable.BannerLayoutStyle_indicatorMargin, indicatorMargin);

autoPlayDuration= array.getInt(R.styleable.BannerLayoutStyle_autoPlayDuration, autoPlayDuration);

scrollDuration= array.getInt(R.styleable.BannerLayoutStyle_scrollDuration, scrollDuration);

isAutoPlay= array.getBoolean(R.styleable.BannerLayoutStyle_isAutoPlay, isAutoPlay);

defaultImage= array.getResourceId(R.styleable.BannerLayoutStyle_defaultImage, defaultImage);

array.recycle();

LayerDrawable unSelectedLayerDrawable;

LayerDrawable selectedLayerDrawable;

GradientDrawable unSelectedGradientDrawable = newGradientDrawable();

GradientDrawable selectedGradientDtawbale = newGradientDrawable();

switch(indicatorShape) {

caserect:

unSelectedGradientDrawable.setShape(GradientDrawable.RECTANGLE);

selectedGradientDtawbale.setShape(GradientDrawable.RECTANGLE);

break;

caseoval:

unSelectedGradientDrawable.setShape(GradientDrawable.OVAL);

selectedGradientDtawbale.setShape(GradientDrawable.OVAL);

break;

}

unSelectedGradientDrawable.setColor(unSelectedIndicatorColor);

unSelectedGradientDrawable.setSize(unSelectedIndecatorWidth, unSelectedIndicatorHeight);

unSelectedLayerDrawable = newLayerDrawable(newDrawable[]{unSelectedGradientDrawable});

unSelectedDrawable= unSelectedLayerDrawable;

selectedGradientDtawbale.setColor(selectedIndicatorColor);

selectedGradientDtawbale.setSize(selectedIndecatorWidth, selectedIndicatorHeight);

selectedLayerDrawable = newLayerDrawable(newDrawable[]{selectedGradientDtawbale});

selectedDrawable= selectedLayerDrawable;

}

/*** 添加本地图片**@paramviewRes图片id集合*@paramtitles标题集合,可空*/public voidsetViewRes(List viewRes, List titles) {

List views = newArrayList<>();

itemCount= viewRes.size();

if(titles != null&& titles.size() != viewRes.size()) {

throw newIllegalStateException("views.size() != titles.size()");

}

// 把数量拼凑到三个以上if(itemCount< 1) {

throw newIllegalStateException("item count not equal zero");

} else if(itemCount< 2) {

views.add(getFrameLayoutView(viewRes.get(0), titles != null? titles.get(0) : null, 0));

views.add(getFrameLayoutView(viewRes.get(0), titles != null? titles.get(0) : null, 0));

views.add(getFrameLayoutView(viewRes.get(0), titles != null? titles.get(0) : null, 0));

} else if(itemCount< 3) {

views.add(getFrameLayoutView(viewRes.get(0), titles != null? titles.get(0) : null, 0));

views.add(getFrameLayoutView(viewRes.get(1), titles != null? titles.get(1) : null, 1));

views.add(getFrameLayoutView(viewRes.get(0), titles != null? titles.get(0) : null, 0));

views.add(getFrameLayoutView(viewRes.get(1), titles != null? titles.get(1) : null, 1));

} else{

for(inti = 0; i < viewRes.size(); i++) {

views.add(getFrameLayoutView(viewRes.get(i), titles != null? titles.get(i) : null, i));

}

}

setViews(views);

}

//添加网络图片路径public voidsetViewUrls(Context context,List urls, List titles) {

List views = newArrayList<>();

itemCount= urls.size();

Log.e("TAG",titles.size()+"---90---"+urls.size());

if(titles != null&& titles.size() != itemCount) {

throw newIllegalStateException("views.size() != titles.size()");

}

//主要是解决当item为小于3个的时候滑动有问题,这里将其拼凑成3个以上if(itemCount< 1) {//当item个数0throw newIllegalStateException("item count not equal zero");

} else if(itemCount< 2) { //当item个数为1views.add(getFrameLayoutView(context,urls.get(0), titles != null? titles.get(0) : null, 0));

views.add(getFrameLayoutView(context,urls.get(0), titles != null? titles.get(0) : null, 0));

views.add(getFrameLayoutView(context,urls.get(0), titles != null? titles.get(0) : null, 0));

} else if(itemCount< 3) {//当item个数为2views.add(getFrameLayoutView(context,urls.get(0), titles != null? titles.get(0) : null, 0));

views.add(getFrameLayoutView(context,urls.get(1), titles != null? titles.get(1) : null, 1));

views.add(getFrameLayoutView(context,urls.get(0), titles != null? titles.get(0) : null, 0));

views.add(getFrameLayoutView(context,urls.get(1), titles != null? titles.get(1) : null, 1));

} else{

for(inti = 0; i < urls.size(); i++) {

views.add(getFrameLayoutView(context,urls.get(i), titles != null? titles.get(i) : null, i));

}

}

setViews(views);

}

private voidsetViews(finalList views) {

mViewPager= newViewPager(getContext());

addView(mViewPager);

setSliderTransformDuration(scrollDuration);

//初始化indicatorContainerindicatorContainer= newLinearLayout(getContext());

indicatorContainer.setGravity(Gravity.CENTER_VERTICAL);

LayoutParams params = newLayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

// 设置 指示点的位置 ALIGN_PARENT_RIGHT表示居右 CENTER_HORIZONTAL表示居中params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);

params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);

//设置marginparams.setMargins(indicatorMargin, indicatorMargin, indicatorMargin, indicatorMargin);

//添加指示器容器布局到SliderLayoutaddView(indicatorContainer, params);

//初始化指示器,并添加到指示器容器布局for(inti = 0; i < itemCount; i++) {

ImageView indicator = newImageView(getContext());

indicator.setLayoutParams(newViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));

indicator.setPadding(indicatorSpace, indicatorSpace, indicatorSpace, indicatorSpace);

indicator.setImageDrawable(unSelectedDrawable);

indicatorContainer.addView(indicator);

}

LoopPagerAdapter pagerAdapter = newLoopPagerAdapter(views);

mViewPager.setAdapter(pagerAdapter);

//设置当前item到Integer.MAX_VALUE中间的一个值,看起来像无论是往前滑还是往后滑都是ok的//如果不设置,用户往左边滑动的时候已经划不动了inttargetItemPosition = Integer.MAX_VALUE/ 2- Integer.MAX_VALUE/ 2% itemCount;

mViewPager.setCurrentItem(targetItemPosition);

switchIndicator(targetItemPosition % itemCount);

mViewPager.addOnPageChangeListener(newViewPager.SimpleOnPageChangeListener() {

@Overridepublic voidonPageSelected(intposition) {

switchIndicator(position % itemCount);

}

});

startAutoPlay();

}

/*** 开始自动轮播*/public voidstartAutoPlay() {

stopAutoPlay(); // 避免重复消息if(isAutoPlay) {

mHandler.sendEmptyMessageDelayed(WHAT_AUTO_PLAY, autoPlayDuration);

}

}

@Overrideprotected voidonWindowVisibilityChanged(intvisibility) {

super.onWindowVisibilityChanged(visibility);

if(visibility == VISIBLE) {

startAutoPlay();

} else{

stopAutoPlay();

}

}

/*** 停止自动轮播*/public voidstopAutoPlay() {

if(isAutoPlay) {

mHandler.removeMessages(WHAT_AUTO_PLAY);

}

}

private voidsetSliderTransformDuration(intscrollDuration) {

try{

Field mScroller = ViewPager.class.getDeclaredField("mScroller");

mScroller.setAccessible(true);

FixedSpeedScroller fixedSpeedScroller = newFixedSpeedScroller(mViewPager.getContext(), null, scrollDuration);

mScroller.set(mViewPager, fixedSpeedScroller);

} catch(Exception e) {

e.printStackTrace();

}

}

@Overridepublic booleandispatchTouchEvent(MotionEvent ev) {

switch(ev.getAction()) {

caseMotionEvent.ACTION_DOWN:

stopAutoPlay();

break;

caseMotionEvent.ACTION_CANCEL:

caseMotionEvent.ACTION_UP:

startAutoPlay();

break;

}

return super.dispatchTouchEvent(ev);

}

/*** 切换指示器状态**@paramcurrentPosition当前位置*/private voidswitchIndicator(intcurrentPosition) {

for(inti = 0; i < indicatorContainer.getChildCount(); i++) {

((ImageView) indicatorContainer.getChildAt(i)).setImageDrawable(i == currentPosition ? selectedDrawable: unSelectedDrawable);

}

}

public voidsetOnBannerItemClickListener(OnBannerItemClickListener onBannerItemClickListener) {

this.mOnBannerItemClickListener= onBannerItemClickListener;

}

@NonNullprivateFrameLayout getFrameLayoutView(Context context, String url, String title, final intposition) {

FrameLayout frameLayout = newFrameLayout(getContext());

FrameLayout.LayoutParams layoutParams = newFrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);

layoutParams.gravity= Gravity.CENTER;

ImageView imageView = newImageView(getContext());

frameLayout.addView(imageView);

frameLayout.setOnClickListener(newOnClickListener() {

@Overridepublic voidonClick(View v) {

if(mOnBannerItemClickListener!= null) {

mOnBannerItemClickListener.onItemClick(position);

}

}

});

imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);

if(defaultImage!= 0){

Glide.with(getContext()).load(url).placeholder(defaultImage).centerCrop().into(imageView);

}else{

Glide.with(getContext()).load(url).centerCrop().into(imageView);

}

if(!TextUtils.isEmpty(title)) {

TextView textView = newTextView(getContext());

textView.setText(title);

textView.setTextColor(titleColor);

textView.setPadding(titlePadding, titlePadding, titlePadding, titlePadding);

textView.setBackgroundColor(titleBGColor);

textView.getPaint().setFakeBoldText(true);

layoutParams.gravity= Gravity.BOTTOM;

frameLayout.addView(textView, layoutParams);

}

returnframeLayout;

}

@NonNullprivateFrameLayout getFrameLayoutView(Integer res, String title, final intposition) {

FrameLayout frameLayout = newFrameLayout(getContext());

FrameLayout.LayoutParams layoutParams = newFrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);

layoutParams.gravity= Gravity.CENTER;

ImageView imageView = newImageView(getContext());

frameLayout.addView(imageView);

frameLayout.setOnClickListener(newOnClickListener() {

@Overridepublic voidonClick(View v) {

if(mOnBannerItemClickListener!= null) {

mOnBannerItemClickListener.onItemClick(position);

}

}

});

imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);

Glide.with(getContext()).load(res).centerCrop().into(imageView);

if(!TextUtils.isEmpty(title)) {

TextView textView = newTextView(getContext());

textView.setText(title);

textView.setTextColor(titleColor);

textView.setPadding(titlePadding, titlePadding, titlePadding, titlePadding);

textView.setBackgroundColor(titleBGColor);

textView.getPaint().setFakeBoldText(true);

layoutParams.gravity= Gravity.BOTTOM;

frameLayout.addView(textView, layoutParams);

}

returnframeLayout;

}

public interfaceOnBannerItemClickListener {

voidonItemClick(intposition);

}

public classLoopPagerAdapter extendsPagerAdapter {

privateList views;

publicLoopPagerAdapter(List views) {

this.views= views;

}

@Overridepublic intgetCount() {

//Integer.MAX_VALUE = 2147483647returnInteger.MAX_VALUE;

}

@Overridepublic booleanisViewFromObject(View view, Object object) {

returnview == object;

}

@OverridepublicObject instantiateItem(ViewGroup container, intposition) {

if(views.size() > 0) {

//position % view.size()是指虚拟的position会在[0,view.size())之间循环View view = views.get(position % views.size());

if(container.equals(view.getParent())) {

container.removeView(view);

}

container.addView(view);

returnview;

}

return null;

}

@Overridepublic voiddestroyItem(ViewGroup container, intposition, Object object) {

}

}

public classFixedSpeedScroller extendsScroller {

private intmDuration= 1000;

publicFixedSpeedScroller(Context context) {

super(context);

}

publicFixedSpeedScroller(Context context, Interpolator interpolator) {

super(context, (android.view.animation.Interpolator) interpolator);

}

publicFixedSpeedScroller(Context context, Interpolator interpolator, intduration) {

this(context, interpolator);

mDuration= duration;

}

@Overridepublic voidstartScroll(intstartX, intstartY, intdx, intdy, intduration) {

// Ignore received duration, use fixed one insteadsuper.startScroll(startX, startY, dx, dy, mDuration);

}

@Overridepublic voidstartScroll(intstartX, intstartY, intdx, intdy) {

// Ignore received duration, use fixed one insteadsuper.startScroll(startX, startY, dx, dy, mDuration);

}

}

}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/536563.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

自我练习

<!doctype html><html><head><meta charset"utf-8"><title>无标题文档</title><link rel"icon" href"../HTMLWork/day03/psb.ico.ico" type"img/*"></head><body> <a na…

android studio按钮槽函数,AndroidStudio按钮Button退出程序

AndroidStudio 3.1.41.创建一个新的项目&#xff0c;项目名称为Button&#xff0c;界面为activity_button.xml2.打开activity_button.xml3.点击HelloWorld标签&#xff0c;按Delete删除4.左侧组件栏选择Common - Button5.将Button组件拖到界面上&#xff0c;大概中间的位置6.右…

cobbler介绍与部署

cobbler介绍 Cobbler是一个Linux系统安装的服务&#xff0c;可以通过网络启动(PXE)的方式来快速安装、重装物理服务器和虚拟机&#xff0c;同时还可以管理DHCP&#xff0c;DNS等。 Cobbler可以使用命令行方式管理&#xff0c;也提供了基于Web的界面管理工具(cobbler-web)&#…

android wifi视频监控软件,WiFi环境下Android智能视频监控系统研究与实现

摘要&#xff1a;在互联网飞速发展和移动互联网强势崛起的时代,科技产品服务于普通生活是新兴行业必然的发展趋势;监控系统是物联网时代各个领域必然争取的可控制系统。随着无线技术和移动终端设备的高歌猛进,移动终端智能无线视频监控系统成为时下监控领域发展的热点方向。无线…

android 本地地址转换为url,android本地mipmap图片转url、绝对路径转URL URL URI File Path 转换...

标签&#xff1a; url uri file pathFile to URI:File file ...;URI uri file.toURI();File to URL:File file ...;URL url file.toURI().URL();URL to File:URL url ...;File file new Path(url.getPath()).toFile();URI to URL:URI uri ...;URL url uri.toURL();URL …

ORACLE数据库导出导入数据

准备工作&#xff1a; 1、登录管理员system 2、create directory dbdata as C:\oracle\tempData;--创建备份文件夹 3、grant read,write on directory dbdata to gsjk2018;--授权读写为用户 --导出(每次修改文件名)expdp gsjk2018/gsjk2018_vimtech10.0.73.32:1521/orcl direct…

linux sed名宁,Linux shell利用sed批量更改文件名的方法

微子网络与大家分享了在Linux shell中使用sed批量更改文件名的方法。希望你看完这篇文章有所收获。大家一起讨论一下。示例去除特定字符目标&#xff1a;把2017-01-01.jpg和2018-01-01.jpg变成20170101.jpg和20180101.jpg方法&#xff1a;用空值替换全部for filein ls | grep …

android手机给iphone越狱,一台ROOT后的安卓手机:可以用来给iOS 13越狱了

iOS 13时代的越狱工具主要包括unc0ver和Checkra1n两款&#xff0c;前者最新的v4.2.1版本已经支持A9到A13设备从除了支持的设备和系统多&#xff0c;unc0ver的一大优势在于可在iOS设备上独立完成越狱操作&#xff0c;Checkra1n则需要借助电脑&#xff0c;包括重启失效后也是如此…

502 Bad Gateway The server returned an invalid or incomplete response

问题描述&#xff1a;最近在登陆某大学网站时&#xff0c;网站如下&#xff1a; https://yzb.tju.edu.cn/ 发现登录不进去&#xff0c;报了502 Bad Gateway The server returned an invalid or incomplete response这个错误。 问题解决&#xff1a;将https改为http&#xff0…

iOS VIPER架构(三)

路由是实现模块间解耦的一个有效工具。如果要进行组件化开发&#xff0c;路由是必不可少的一部分。目前iOS上绝大部分的路由工具都是基于URL匹配的&#xff0c;优缺点都很明显。这篇文章里将会给出一个更加原生和安全的设计&#xff0c;这个设计的特点是&#xff1a; 路由时用p…

android camera滑动,Android怎么实现小米相机底部滑动指示器

Android怎么实现小米相机底部滑动指示器发布时间&#xff1a;2021-04-15 14:39:38来源&#xff1a;亿速云阅读&#xff1a;94作者&#xff1a;小新这篇文章给大家分享的是有关Android怎么实现小米相机底部滑动指示器的内容。小编觉得挺实用的&#xff0c;因此分享给大家做个参考…

laravel安装laravel-ide-helper扩展进行代码提示(二)

一、扩展的地址 https://github.com/barryvdh/laravel-ide-helper二、安装扩展 1、引入库&#xff1a; composer require barryvdh/laravel-ide-helper composer require doctrine/dbal如果只想在开发环境上使用&#xff0c;请加上--dev composer require --dev barryvdh/larav…

android md 颜色,安卓MD(Material Design)规范

Md规范是一种设计风格&#xff0c;并不特指规范。是一种模拟纸张的手法。一、核心思想把物理世界的体验带进屏幕。去掉现实中的杂质和随机性&#xff0c;保留其最原始纯净的形态、空间关系、变化与过度&#xff0c;配合虚拟世界的灵活特性&#xff0c;还原最贴近真实的体验&…

Mariadb修改root密码

2019独角兽企业重金招聘Python工程师标准>>> 默认情况下&#xff0c;新安装的 mariadb 的密码为空&#xff0c;在shell终端直接输入 mysql 就能登陆数据库。 如果是刚安装第一次使用&#xff0c;请使用 mysql_secure_installation 命令初始化。 # mysql_secure_inst…

【译】Googler如何解决编程问题

本文是Google工程师Steve Merritt的一篇博客&#xff0c;向大家介绍他自己和身边的同事解决编程问题的方法。 原文地址&#xff1a;blog.usejournal.com/how-a-googl… 在本文中&#xff0c;我将完整的向你介绍一种解决编程问题的策略&#xff0c;这个策略是我在日常工作中一直…

自学html和css,学习HTML和CSS的5大理由

描述人们学习HTML和CSS最常见的原因是开始从事web开发。但并不是只有web开发人员才要学习HTML和CSS的核心技术。作为一个网络用户&#xff0c;你需要你掌握的相关技术很多&#xff0c;但下面有5个你无法拒绝学习HTML和CSS的理由。1、轻松制作卡通动画Web上的动画很多年来都是使…

html 左侧 树形菜单,vue左侧菜单,树形图递归实现代码

学习vue有一段时间了&#xff0c;最近使用vue做了一套后台管理系统&#xff0c;左侧菜单需求是这样的&#xff0c;可以多层&#xff0c;数据由后台传递。也因为自己对官方文档的不熟悉使得自己踩了不少坑&#xff0c;今天写出来和大家一起分享。效果图如下所示&#xff1a;先说…

Node.js的基本使用3

koa(扩展知识&#xff0c; 建议学习) koa是express超集&#xff08;进阶版&#xff09;前后端分离和耦合概念介绍 面向过程 -》 面向对象 --》 面向服务数据库 Node.js mongodb(bson json的超集) 分类&#xff1a; 关系型数据库&#xff1a; MySql非关系型数据库: MongoDB Mong…

Flutter的滚动以及sliver约束

Flutter框架中有很多滚动的Widget,ListView、GridView等&#xff0c;这些Widget都是使用Scrollable配合Viewport来完成滚动的。我们来分析一下这个滚动效果是怎样实现的。 Scrollable在滚动中的作用 Scrollable继承自StatefulWidget&#xff0c;我们看一下他的State的build方法…

页面增加html,为静态页面HTML增加session功能

一般来说&#xff0c;只有服务器端的CGI程序(ASP、PHP、JSP)具有session会话功能&#xff0c;用来保存用户在网站期间(会话)的活动数据信息&#xff0c;而对于数量众多的静态页面(HTML)来说&#xff0c;只能使用客户端的cookies来保存临时活动数据&#xff0c;但对于cookies的操…