2013年5月13日 android :Animation;Theme、Style;Custom Title
来源:互联网 发布:2016年上证指数数据 编辑:程序博客网 时间:2024/04/20 18:24
=================== Animation ======================
Animation:
Tween Animation 对单个图像进行各种变换(缩放,平移,旋转等)来实现动画。Frame Animation 由一组图像顺序显示显示动画。
使用XML定义动画,定义在res/anim文件夹下:
<set> 为其它animation类型<alpha>,<scale>,<translate>和<rotate>或其它<set>的容器。<alpha> 定义Fade in , Fade out 动画,其对应的Android类AlphaAnimation,参数由fromAlpha,toAlpha定义。
<scale> 定义缩放动画,其对应的Android类为ScaleAnimation,参数由 fromXScale,toXScale,fromYScale,toYScale,pivotX,pivotY定义,pivotX,pivotY定义了缩放时的中心。
<translate> 定义平移动画,其对应的Android类为TranslateAnimation,参数由fromXDelta,toXDelta,fromYDelta,toYDelta 定义。
<rotate> 定义选择动画,其对应的Android类RotateAnimation,参数由fromDegrees,toDegrees,pivotX,pivotY, pivotX,pivotY定义选择中心。
Activity Animation到其它Activity Controls 切换的动画使用 overridePendingTransition来定义,函数overridePendingTransition(int enterAnim, int exitAnim) 必须定义在StartActivity(Intent)或是 Activity.finish()之后来定义两个Activity切换时的动画,enterAnim 为新Activity出现时动画效果,exitAnim则定义了当前Activity退出时动画效果。
=================== Theme、Style ======================
Theme 为一组相关的Style定义
定义在/res/values子目录下
Theme 和Style的区别在于Theme应用于Activity和Application而 Style应用于单个的View
Style 定义支持 Inheritance,使用parent
<style name=”Theme.CustomDialog” parent=”android:style/Theme.Dialog”>
<item name=”android:windowBackground”>@drawable/filled_box</item>
< /style>
定义Activity的Theme
<activity android:name=”.app.CustomDialogActivity”
android:theme=”@style/Theme.CustomDialog“>
...
</activity>
=================== Custom Title ======================
Activity包含的对象:由setContentView设置的Content View 和 Windows对象
Windows 类对象用于控制标题栏,可以允许自定义标题栏或是不显示标题栏。
Windows 定义了一些Feature,允许开发人员做些定制:自定义标题栏对应的Feature ID为Window.FEATURE_CUSTOM_TITLE
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.custom_title); // 设置 Content View
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title_1); // 设置 title
- 2013年5月13日 android :Animation;Theme、Style;Custom Title
- 2013年3月17日----Android主题(Theme)实现
- android set custom theme
- android App title theme
- android:theme & android:style
- Style android:style/Theme.Dialog
- android style & theme
- android (style&theme)
- Android Theme Style
- Android Style与Theme .
- android:style/Theme
- android Theme & Style
- android开发 Theme style
- android:style与theme
- android theme & style
- android:style/Theme
- Android:Theme 和 style
- Android自定义Theme&style
- Keep-Alive简介及在Tomcat中配置
- CF 304B(Calendar-一段时间的日期)
- 容易犯错的做法
- 编译QT4.5.3中出现的错误
- Servlet/Filter 的生命周期
- 2013年5月13日 android :Animation;Theme、Style;Custom Title
- 2013-05-13
- 图片,音频,视频文件的上传 以及图片缩略图的制作,音频文件时长的获取以及 视频文件缩略图的获取
- 进程和线程的区别
- 体内湿气不排出,永远睡不饱
- 从linux内核启动说起(二)
- 红黑树插入的栈实现
- A+B Format (20)
- 常用的Python命令