轮播图
来源:互联网 发布:mac怎么卸载 编辑:程序博客网 时间:2024/05/18 20:07
之前在网上找的图片轮播图研究学习了半天,发现图片轮播的时候有声音,而且退出程序后竟然在后台继续运行发出声音“滴 。。。滴。。。滴”,今天找了下轮播图发现一个非常棒的例子,顺便分享出来。
参考链接 https://github.com/gcgongchao/flashview
http://blog.csdn.net/wangjinyu501/article/details/8169924
在MainActivity中只需要写这些代码就可以实现效果(需要引入作者提供的库文件)
package com.general.android.flashviewdemo;import android.app.Activity;import android.os.Bundle;import com.gc.flashview.FlashView;import com.gc.flashview.constants.EffectConstants;import java.util.ArrayList;public class MainActivity extends Activity { private FlashView flashView; private ArrayList<String> imageUrls; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); flashView=(FlashView)findViewById(R.id.flash_view); imageUrls=new ArrayList<String>();// imageUrls.add("http://image.baidu.com/search/detail?ct=503316480&tn=baiduimagedetail&statnum=wallpaper&ipn=d&z=0&s=0&ic=0&lm=-1&itg=0&cg=wallpaper&word=%E5%A3%81%E7%BA%B8&ie=utf-8&in=3354&cl=2&st=&pn=0&rn=1&di=0&ln=1000&&fmq=1378374347070_R&se=&sme=0&tab=&face=&&cs=1271743327,1430666038&adpicid=0&pi=0&os=2691782811,855557015&istype=&ist=&jit=&objurl=http%3A%2F%2Fa.ikafan.com%2Fattachment%2Fforum%2Fmonth_0807%2F20080726_877668de4f27856575b3y1PzoiAhYveb.jpg&bdtype=-1&gsm=200003c"); imageUrls.add("http://www.juzi2.com/uploads/allimg/130619/1_130619193218_1.jpg"); imageUrls.add("http://a.hiphotos.baidu.com/zhidao/pic/item/4034970a304e251f4dd80e61a786c9177f3e5378.jpg"); imageUrls.add("http://f.hiphotos.baidu.com/zhidao/pic/item/9e3df8dcd100baa12801ad224710b912c8fc2e7e.jpg");// imageUrls.add("http://www.kole8.com/desktop/desk_file-11/2/2/2012/11/2012113013552959.jpg");// imageUrls.add("http://www.237.cc/uploads/pcline/712_0_1680x1050.jpg"); flashView.setImageUris(imageUrls); flashView.setEffect(EffectConstants.DEFAULT_EFFECT);//更改图片切换的动画效果 }}
就这样就可以愉快的增加到自己的项目去了
备注 :轮播图下面的点的背景写法
参考链接 https://github.com/gcgongchao/flashview
http://blog.csdn.net/wangjinyu501/article/details/8169924
1 0
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- 轮播图
- QML视图元素 Visual Elements In QML Qt 5.6.0 Reference Documentation
- 希尔排序 时间复杂度 证明
- 启动图片
- Matlab SVM
- 栈的应用实践——括号匹配的检验
- 轮播图
- 如何支持多种设备-语言篇
- QML Applications
- Objective-C 内存管理
- 数据结构算法——顺序表应用
- 基于Easyx的文本显示器的C语言实现——源码+实验报告
- LeetCode 81. Search in Rotated Sorted Array II
- 装饰器 ---- python
- LeetCode——049