四、ViewFlipper的详细使用设置View
1.首先在xml中声明ViewFlipper
<LinearLayout
android:layout_width=“match_parent”
android:layout_height=“100dp”
android:orientation=“horizontal”>
<ImageView
android:layout_width=“0dp”
android:layout_height=“60dp”
android:layout_weight=“1”
android:src=“@mipmap/toutiao”/>
<View
android:layout_width=“1dp”
android:layout_height=“60dp”
android:background=“#b6b5b5”
android:layout_marginLeft=“5dp”
android:layout_marginRight=“5dp”/>
<ViewFlipper
android:id=“@+id/view_flipper”
android:layout_width=“0dp”
android:layout_weight=“4”
android:layout_height=“60dp”
android:autoStart=“true”
android:flipInterval=“3000”
android:inAnimation=“@anim/flipper_in_anim”
android:outAnimation=“@anim/flipper_out_anim”/>
2.在res下创建anim文件夹,并在里面创建两个xml分别是入场动画和出场动画
<translate xmlns:android=“http://schemas.android.com/apk/res/android”
android:fromYDelta=“100%p”
android:toYDelta=“0”
android:duration=“1500”>
<translate xmlns:android=“http://schemas.android.com/apk/res/android”
android:fromYDelta=“0”
android:toYDelta=“-100%p”
android:duration=“1500”>
3.在java代码中初始化ViewFlipper,并添加子布局(在这里我们只显示了一个子布局)
<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”
android:orientation=“vertical” android:layout_width=“match_parent”
android:layout_height=“match_parent”>
<LinearLayout
android:layout_width=“match_parent”
android:layout_height=“0dp”
android:layout_weight=“1”
android:orientation=“horizontal”>
<TextView
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text=" 运动 "
android:textColor=“#ff0000”
android:background=“@drawable/text_shap”/>
<TextView
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text=" 精致!哈登上脚 Harden 1"/>
<LinearLayout
android:layout_width=“match_parent”
android:layout_height=“0dp”
android:layout_weight=“1”
android:orientation=“horizontal”>
<TextView
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text=" 热品 "
android:textColor=“#ff0000”
android:background=“@drawable/text_shap”/>
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数初中级Android工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则近万的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Android移动开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:Android)
总结:
各行各样都会淘汰一些能力差的,不仅仅是IT这个行业,所以,不要被程序猿是吃青春饭等等这类话题所吓倒,也不要觉得,找到一份工作,就享受安逸的生活,你在安逸的同时,别人正在奋力的向前跑,这样与别人的差距也就会越来越遥远,加油,希望,我们每一个人,成为更好的自己。
-
BAT大厂面试题、独家面试工具包,
-
资料包括 数据结构、Kotlin、计算机网络、Framework源码、数据结构与算法、小程序、NDK、Flutter
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!
据结构、Kotlin、计算机网络、Framework源码、数据结构与算法、小程序、NDK、Flutter
[外链图片转存中…(img-VOIYuGTR-1713735117232)]
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!