当前位置: 首页 > news >正文

网站开发助理是干啥的/新闻播报最新

网站开发助理是干啥的,新闻播报最新,南京鼓楼做网站,宠物网站建设的目的结论:overridePendingTransition代码方式在手机动画关闭的状态下是无效的;自定义theme方式下,Animation.Activity的4个属性中,在动画关或者不关闭的状态下只有两个有效;(推荐使用)windowEnterAnimationwindowExitAnima…

结论:

overridePendingTransition代码方式在手机动画关闭的状态下是无效的;

自定义theme方式下,Animation.Activity的4个属性中,在动画关或者不关闭的状态下只有两个有效;(推荐使用)

windowEnterAnimation

windowExitAnimation

windowShowAnimation//无效

windowHideAnimation//无效

具体操作方法不赘述了:

2.说说我碰到的问题:

首先是xml方式,因为Activity继承自AppCompatActivity,在继承主题时会报

You need to use a Theme.AppCompat theme (or descendant) with this activity.

错误,需要取用合适的theme

这并不是重点,重点是程序运行起来之后根本没有动画效果,我在确认动画xml文件的参数后,依然没有效果(上面链接的博文中的倒数第二个xml文件的参数设置是有问题的)

//应该是

fromXDelta="100%"

回到重点,无奈之下,查看style.xml源代码,发现了Animation.Activity的一系列参数:

@anim/activity_open_enter

@anim/activity_open_exit

@anim/activity_close_enter

@anim/activity_close_exit

@anim/task_open_enter

@anim/task_open_exit

@anim/launch_task_behind_target

@anim/launch_task_behind_source

@anim/task_close_enter

@anim/task_close_exit

@anim/task_open_enter

@anim/task_open_exit

@anim/task_close_enter

@anim/task_close_exit

@anim/wallpaper_open_enter

@anim/wallpaper_open_exit

@anim/wallpaper_close_enter

@anim/wallpaper_close_exit

@anim/wallpaper_intra_open_enter

@anim/wallpaper_intra_open_exit

@anim/wallpaper_intra_close_enter

@anim/wallpaper_intra_close_exit

@animator/fragment_open_enter

@animator/fragment_open_exit

@animator/fragment_close_enter

@animator/fragment_close_exit

@animator/fragment_fade_enter

@animator/fragment_fade_exit

逐一实验,发现其中只有两项参数对单一的activity有效果:

windowEnterAnimation和windowExitAnimation

@anim/activity_in_left

@anim/activity_out_right

如果想得到没有titlebar的activity主题,需要这样写:

@style/AnimationActivity

true

@anim/activity_in_left

@anim/activity_out_right

另外,代码方式,我试过,也未见效果,最后才发现是调试的手机动画效果没开。。。。

其实在自己写动画的过程中利用Android自带的动画库可以实习部分位移效果,只是不满足activity连续画面的要求,下面贴出我写的位移AnimUtil类的部分代码:

/** *@return */

private static TranslateAnimation moveFromTo(float fromX, float toX, float fromY, float toY) {

TranslateAnimation mHiddenAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF, fromX,

Animation.RELATIVE_TO_SELF, toX, Animation.RELATIVE_TO_SELF,

fromY, Animation.RELATIVE_TO_SELF, toY);

mHiddenAction.setDuration(CData.AnimaDura);

return mHiddenAction;

}

/** *@return */

private static TranslateAnimation moveFromTo(float fromX, float toX, float fromY, float toY, long duration) {

TranslateAnimation mHiddenAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF, fromX,

Animation.RELATIVE_TO_SELF, toX, Animation.RELATIVE_TO_SELF,

fromY, Animation.RELATIVE_TO_SELF, toY);

mHiddenAction.setDuration(duration);

return mHiddenAction;

}

public static void hideFromLeftToRight(View view) {

view.setAnimation(AnimatorU.moveFromTo(0, 1, 0, 0));

view.setVisibility(View.INVISIBLE);

}

public static void showFromRightToLeft(View view) {

view.setVisibility(View.VISIBLE);

view.setAnimation(AnimatorU.moveFromTo(1, 0, 0, 0));

}

public static void hideFromRightToLeft(View view) {

view.setAnimation(AnimatorU.moveFromTo(0, -1, 0, 0));

view.setVisibility(View.INVISIBLE);

}

public static void showFromLeftToRight(View view) {

view.setVisibility(View.VISIBLE);

view.setAnimation(AnimatorU.moveFromTo(-1, 0, 0, 0));

}

如果不是切换activity,而是让布局中的某个控件有位移效果的话,这个AnimatorU足够使用了。

关键是参数中的(fromX,toX,fromY,toY)结合type参数,相信稍微开动一下脑筋就能明白其中原理

http://www.lbrq.cn/news/809767.html

相关文章:

  • 网络架构中sdn是指/长沙百度推广优化排名
  • 网站开发系统测试/2023年最新新闻简短摘抄
  • 全国行业名录搜索系统官网/快速seo关键词优化技巧
  • php旅游类网站开发毕业设计/网站营销策划公司
  • 邢台网站制作费用/seo在线优化
  • 租号网站咋做/广州新闻播报
  • 刘家窑网站建设公司/seo外包网络公司
  • php做网站很快嘛/西安关键词排名软件
  • react企业网站模板/照片查询百度图片搜索
  • 租房子做民宿在哪个网站/电商关键词一般用哪些工具
  • 网站建设的大公司/seo优化是怎么回事呢
  • 音乐网站设计/网络推广seo是什么
  • 广州红鼎网站建设有限公司怎么样/优化网站服务
  • 湖北建设信息网站/营销推广渠道有哪些
  • 做关于灯饰的网站/平台app如何推广
  • 贸易公司 网站 扶持/网页怎么搜索关键词
  • 一个公司做2个产品网站怎么做的/外链生成器
  • 网站腾讯qq对话框怎么做/网站收录提交
  • 能进封禁网站的浏览器/沈阳seo建站
  • 竞拍网站开发/厦门人才网个人登录
  • 班级动态网站怎么做/2023年4 5月份疫情结束吗
  • 网站建设如何在宣传部备案/潜江seo
  • 有自己网站做淘宝客赚钱/提升seo排名平台
  • 专业的网站建设联系/湖南网站推广
  • 帝国手机网站cms系统/百度推广有哪些售后服务
  • 莱西网站制作联赛与超/微信客户管理系统平台
  • 富邦建设控股集团网站/百度推广一般要多少钱
  • 遵义花果园网站建设/活动软文怎么写
  • 商务部网站市场体系建设司子站/百度关键字推广费用
  • wordpress模板商店/网站建设方案优化
  • Mysql表的增删改查(进阶)
  • fchown/fchownat系统调用及示例
  • 【历史人物】【韩愈】简历与生平
  • C/C++核心知识点详解
  • C 语言第 10 天学习笔记:字符串基础操作与相关函数
  • 积分兑换小程序Java