一、activity_main.xml


进入动画

采用RelativeLayout布局,只含一个TextView控件,宽高采用match_parent,在textView里添加背景图片和文字。

android:background="@drawable/start_bg"

android:gravity="center"//使文字居中

android:text="嫦\n娥\n的\n故\n事"

二、activity_rocket_show.xml


主界面

采用RelativeLayout总布局,布局里添加背景图片。内含两个ImageView(roc_boom_img & roc_rocket_img)和两个Button(roc_shoot_btn & roc_rocket_fire_btn)。

(一)roc_boom_img

bomb_animation是帧动画,需要先在xml文件里配置。

android:layout_width="120dp"//wrap_content:原有的大小有点小

android:layout_height="wrap_content"

android:background="@drawable/bomb_animation"//在background里引入动画

android:visibility="gone"//先设为不可见

(二)roc_rocket_img

rocket_fire_animation是帧动画,height和width都用wrap{_content即可,依凭父控件定位。

android:layout_alignParentBottom="true"

android:background="@drawable/rocket_fire_animation"

(三)roc_shoot_btn

height和width都用wrap{_content,依凭父控件定位。

android:layout_alignParentBottom="true"

android:layout_alignParentRight="true"

(四)roc_rocket_fire_btn

height和width都用wrap{_content,依凭父控件和shoot_btn定位。

android:layout_alignParentBottom="true"

android:layout_toLeftOf="@+id/roc_shoot_btn"

更多相关文章

  1. android布局属性总结备用
  2. Android快速开发框架Android_BaseLib,集成了常用工具类,自定义View
  3. Android属性动画Property Animation系列二之ObjectAnimator
  4. Android(安卓)使用ActivityOptions实现Activity转场动画
  5. android 基本概念和一些术语
  6. android开机动画bootanimation
  7. Android(安卓)编程下 Touch 事件的分发和消费机制
  8. android动画之android:interpolator属性使用
  9. Android之布局

随机推荐

  1. android无framework Java应用开发
  2. Android(安卓)中日期和秒数的转换
  3. Android菜单详解(四)——使用上下文菜单Con
  4. android技术篇(一)解锁bootloader
  5. Android中MediaMuxer跟MediaCodec用例
  6. Android自动化测试之如何安装Android虚拟
  7. Android与JS互调的简单使用
  8. android开启线程的误区
  9. 我的Android音乐播放器
  10. 多个 Android Drawable shape 组合画田字