一、activity_main.xml


动画·界面_第1张图片 进入动画

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

android:background="@drawable/start_bg"

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

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

二、activity_rocket_show.xml


动画·界面_第2张图片 主界面

采用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 自动化测试—robotium(三)EditText控件
  2. android动画之android:interpolator属性使用
  3. Android 使用ActivityOptions实现Activity转场动画
  4. Android快速开发框架Android_BaseLib,集成了常用工具类,自定义View
  5. Android属性动画Property Animation系列二之ObjectAnimator
  6. Android 官方文档:(一)动画和图像 —— 1.5 画布和画图
  7. Android Animation开机动画的优化
  8. Android 下拉框第三方控件 NiceSpinner

随机推荐

  1. Android Surface 介绍
  2. Android 几个常见异常且容易被忽略的地方
  3. Activity切换 窗口绘制显示
  4. android打开各种文件的类
  5. Android微信分享---点击分享伤害了我且一
  6. android Toast居中最简单例子
  7. Android在Gallery中每次滑动只显示一页
  8. iphone开发
  9. Android 学习--ListView 的使用(三)
  10. Android仿QQ消息导航UI