当前位置:网站首页>Functions and usage of viewflipper
Functions and usage of viewflipper
2022-07-07 17:36:00 【XLMN】
viewflipper The function and usage of
viewflipper Inherited viewanimator, Callable addview(view v) Add multiple components once to viewflipper After adding multiple components ,viewflipper You can use animation to control the switching effect between multiple components
public class MainActivity extends Activity {
private ViewFlipper vf;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.viewflipper);
vf = (ViewFlipper) findViewById(R.layout.viewflipper);
}
public void prev(View view) {
// TODO Auto-generated method stub
vf.setInAnimation(this, android.R.anim.slide_in_left);
vf.setOutAnimation(this, android.R.anim.slide_out_right);
// Show previous component
vf.showPrevious();
// Stop autoplay
vf.stopFlipping();
}
public void next(View view) {
// TODO Auto-generated method stub
vf.setInAnimation(this, android.R.anim.slide_in_left);
vf.setOutAnimation(this, android.R.anim.slide_out_right);
// Show the next
vf.showNext();
// Stop autoplay
vf.stopFlipping();
}
public void auto(View view) {
// TODO Auto-generated method stub
vf.setInAnimation(this, android.R.anim.slide_in_left);
vf.setOutAnimation(this,android.R.anim.slide_out_right);
// Start autoplay
vf.startFlipping();
}
}
<?xml version="1.0" encoding="utf-8"?><!-- android:flipInterval="1000" It means setting up every one of them View Time shown ; -->
<ViewFlipper
android:id="@+id/viewflipper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:flipInterval="1000" >
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/love" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/mia" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/mia10" />
</ViewFlipper>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:onClick="prev"
android:text="&lt" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:onClick="auto"
android:text=" Auto play " />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:onClick="next"
android:text="&gt" />
边栏推荐
- A tour of grpc:03 - proto serialization / deserialization
- 【网络攻防原理与技术】第5章:拒绝服务攻击
- 第3章业务功能开发(实现记住账号密码)
- mysql官网下载:Linux的mysql8.x版本(图文详解)
- 第1章CRM核心业务介绍
- Flash build API Service - generate API documents
- viewflipper的功能和用法
- Rpcms method of obtaining articles under the specified classification
- Lex & yacc of Pisa proxy SQL parsing
- 【饭谈】那些看似为公司着想,实际却很自私的故事 (一:造轮子)
猜你喜欢
99%的人都不知道|私有化部署还永久免费的即时通讯软件!
mysql官网下载:Linux的mysql8.x版本(图文详解)
麒麟信安操作系统衍生产品解决方案 | 存储多路径管理系统,有效提高数据传输可靠性
麒麟信安加入宁夏商用密码协会
【TPM2.0原理及应用指南】 16、17、18章
科普达人丨一文弄懂什么是云计算?
简单的loading动画
【可信计算】第十三次课:TPM扩展授权与密钥管理
第3章业务功能开发(安全退出)
User defined view essential knowledge, Android R & D post must ask 30+ advanced interview questions
随机推荐
阿富汗临时政府安全部队对极端组织“伊斯兰国”一处藏匿点展开军事行动
使用 xml资源文件定义菜单
本周小贴士#140:常量:安全习语
DNS series (I): why does the updated DNS record not take effect?
PLC: automatically correct the data set noise, wash the data set | ICLR 2021 spotlight
麒麟信安中标国网新一代调度项目!
赋能智慧电力建设 | 麒麟信安高可用集群管理系统,保障用户关键业务连续性
自定义View必备知识,Android研发岗必问30+道高级面试题
本周小贴士131:特殊成员函数和`= default`
NeRF:DeepFake的最终替代者?
L1-023 输出GPLT(Lua)
字符串 - string(Lua)
第3章业务功能开发(用户访问项目)
【TPM2.0原理及应用指南】 9、10、11章
LeetCode 648(C#)
Solidity 开发环境搭建
[Huang ah code] Why do I suggest you choose go instead of PHP?
企业即时通讯软件是什么?它有哪些优势呢?
TabHOST 选项卡的功能和用法
Flask搭建api服务-生成API文档