android layout animation,Android layoutAnimation详解及应用

Android layoutAnimation详解及应用

前言:

最近在玩一个APP的时候,发现刚进入他的页面,他页面的子控件都是从右侧飞过来的,感觉好牛逼的样子,就顺便模仿了一个。看着确实是比死板呆在那舒服多了!

e5c20ae22979826c4d38f49546014225.gif

还是感觉很好看!反正我觉得比死板呆在那好看!你们觉得那!

在看咱们模仿的:

4230d912f9b3cf4e3cb9d947dcf7b2c5.gif

差不多,在微调一下就好了!

上点代码,其实很简单:

首先新建一个anim文件夹在里面新建两个xml

android:delay="90%" //空间的执行间隔

android:animation="@anim/trans" />

android:fromXDelta="100%p" android:toXDelta="0"

android:duration="200" />

android:fromAlpha="0" android:toAlpha="1"

android:duration="200"

/>

只要把这个动画在布局里面设置一下就出现这个效果,碉堡了!

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:background="#e6e6e6"

android:layoutAnimation="@anim/anim"

android:orientation="vertical" >

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:gravity="center|left"

android:background="#ffffff"

android:layout_margin="5dip"

android:orientation="horizontal" >

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/ic_launcher" />

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="TextView" />

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:gravity="center|left"

android:background="#ffffff"

android:layout_margin="5dip"

android:orientation="horizontal" >

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/ic_launcher" />

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="TextView" />

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:gravity="center|left"

android:background="#ffffff"

android:layout_margin="5dip"

android:orientation="horizontal" >

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/ic_launcher" />

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="TextView" />

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:gravity="center|left"

android:background="#ffffff"

android:layout_margin="5dip"

android:orientation="horizontal" >

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/ic_launcher" />

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="TextView" />

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:gravity="center|left"

android:background="#ffffff"

android:layout_margin="5dip"

android:orientation="horizontal" >

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/ic_launcher" />

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="TextView" />

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:gravity="center|left"

android:background="#ffffff"

android:layout_margin="5dip"

android:orientation="horizontal" >

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/ic_launcher" />

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="TextView" />

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:gravity="center|left"

android:background="#ffffff"

android:layout_margin="5dip"

android:orientation="horizontal" >

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:src="@drawable/ic_launcher" />

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="TextView" />

就这么简单的几句话,感觉用户体验顿时上升了不少!真是细节决定成败啊!

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值