Android 图片闪烁(延迟切换)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" > <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" /> <ViewFlipper
android:id="@+id/flipper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="10dp"
android:flipInterval="200" > <TextView
android:id="@+id/text_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="text_1" /> <TextView
android:id="@+id/text_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="text_12" /> <TextView
android:id="@+id/text_3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="text_13" /> <TextView
android:id="@+id/text_4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="text_14" />
</ViewFlipper> <Button
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="stop" /> </LinearLayout>
package com.example.demoviewfliper; import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ViewFlipper; public class MainActivity extends Activity {
ViewFlipper mVf;
Button btn; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); mVf = (ViewFlipper) findViewById(R.id.flipper);
mVf.startFlipping(); btn = (Button) findViewById(R.id.btn);
btn.setOnClickListener(new View.OnClickListener() { @Override
public void onClick(View v) {
if (mVf != null && mVf.isFlipping()) {
mVf.stopFlipping();
mVf.setDisplayedChild(mVf.getChildCount() - 1);
} }
});
} }
Android 图片闪烁(延迟切换)的更多相关文章
- android 图片浏览器滑动切换图片
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools= ...
- android图片闪烁或帧动画
remote_recording_transition.xml 文件 <?xml version="1.0" encoding="utf-8"?> ...
- 一起写一个Android图片轮播控件
注:本文提到的Android轮播控件Demo地址: Android图片轮播控件 1. 轮播控件的组成部分 我们以知乎日报Android客户端的轮播控件为例,分析一下轮播控件的主要组成: 首先我们要有用 ...
- Android图片加载库的理解
前言 这是“基础自测”系列的第三篇文章,以Android开发需要熟悉的20个技术点为切入点,本篇重点讲讲Android中的ImageLoader这个库的一些理解,在Android上最让人头疼是 ...
- Android——例子:屏幕切换
效果图如下: Xml文件代码: <?xml version="1.0" encoding="utf-8" ...
- 简单实现图片间的切换动画 主要用到ViewPager
简单实现图片间的切换动画 主要用到ViewPagerViewPager是android扩展包v4包中的类,这个类可以让用户左右切换当前的view.ViewPager类需要一个PagerAdapter适 ...
- openLayers 4 canvas图例绘制,canvas循环添加图片,解决图片闪烁问题
一.问题来源: 接触Openlayers 一段时间了,最近做了一个农业产业系统,项目中涉及到产业图例,最后考虑用canvas来绘制图例图像.当中带图片的图例移动时,图片会实现闪烁留白情况.闪烁是因为绘 ...
- Android图片加载框架最全解析(八),带你全面了解Glide 4的用法
本篇将是我们这个Glide系列的最后一篇文章. 其实在写这个系列第一篇文章的时候,Glide就推出4.0.0的RC版了.那个时候因为我一直研究的都是Glide 3.7.0版本,再加上RC版本还不太稳定 ...
- Android图片缓存之Lru算法
前言: 上篇我们总结了Bitmap的处理,同时对比了各种处理的效率以及对内存占用大小.我们得知一个应用如果使用大量图片就会导致OOM(out of memory),那该如何处理才能近可能的降低oom发 ...
随机推荐
- tokudb
经测试,tokudb 的事务会锁表,不管有没有用到索引,触发器也会锁表,(可能触发器和事务的原理是一样的吧).innodb 只会锁行. 竟然把这么坑的数据库用到线上来了,这下坑爹了.
- python 函数式编程工具
有三个内置函数与列表一起使用时非常有用:filter().map()和reduce(). 1. filter(function, sequence)返回的序列由function(item)结果为真的元 ...
- native2ascii.exe
native2ascii.exe 是 Java 的一个文件转码工具,是将特殊各异的内容 转为 用指定的编码标准文体形式统一的表现出来,它通常位于 JDK_home\bin 目录下,安装好 Java S ...
- git 教程(8)--删除文件
在Git中,删除也是一个修改操作,我们实战一下,先添加一个新文件test.txt到Git并且提交:
- BZOJ 2342: [Shoi2011]双倍回文
Sol Manacher. 非常裸的Manacher啊...为什么有那么多人写Manacher+并查集?Set?Treap?...好神奇... 你只需要在 \(p[i]++\) 的位置加上判断就可以了 ...
- java中类名,方法,变量,包名等大小写命名规范
类名:首字母大写,其他单词中首字母大写,其他小写方法名:首字母小写,其他单词中首字母大写,其他小写变量:与方法名规则同包名:全部小写接口interface:I开头
- hibernate日常BUG总结
在使用hibernate自动生产表的时候失败, 是配置文件我是从别地方拷贝过来忘记更改,所以报了这个错误. 重新命名了生成表的名称,问题解决! 问题很明显,自动增长的主键应该使用整型. 这里写的是St ...
- Jquery ajax调用webservice总结
jquery ajax调用webservice(C#)要注意的几个事项: 1.web.config里需要配置2个地方 <httpHandlers> <remove verb ...
- HTML 返回顶部的样式
.fhdb{ width:50px; height:50px; position:fixed; //可以用来定义元素的固定定位. right:20px; //距离右侧20像素 botto ...
- 用extern定义全局变量
1.extern的作用 extern有两个作用,第一个,当它与"C"一起连用时,如: extern "C" void fun(int a, int b); 则告 ...