四、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)
最后
对于很多初中级Android工程师而言,想要提升技能,往往是自己摸索成长,不成体系的学习效果低效漫长且无助。整理的这些架构技术希望对Android开发的朋友们有所参考以及少走弯路,本文的重点是你有没有收获与成长,其余的都不重要,希望读者们能谨记这一点。
同时我经过多年的收藏目前也算收集到了一套完整的学习资料以及高清详细的Android架构进阶学习导图及笔记分享给大家,希望对想成为架构师的朋友有一定的参考和帮助。
下面是部分资料截图,诚意满满:特别适合有开发经验的Android程序员们学习。
不论遇到什么困难,都不应该成为我们放弃的理由!
如果你看到了这里,觉得文章写得不错就给个赞呗?如果你觉得那里值得改进的,请给我留言,一定会认真查询,修正不足,谢谢。
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!
00278353)]
不论遇到什么困难,都不应该成为我们放弃的理由!
如果你看到了这里,觉得文章写得不错就给个赞呗?如果你觉得那里值得改进的,请给我留言,一定会认真查询,修正不足,谢谢。
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!