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

大于二高端网站建设公司网站推广费用

大于二高端网站建设,公司网站推广费用,django网站开发教程,品牌线上推广方式需求 电视开发最常见的就是view获焦后要有放大效果,让用户明显看到。这里总结两个实现方法,以后遇到其他的再补充。 方式一:ViewCompat.animate(view) 1、注册焦点变化监听 mBtnFocus1.setOnFocusChangeListener(this);2、有焦点变化的时…

需求

电视开发最常见的就是view获焦后要有放大效果,让用户明显看到。这里总结两个实现方法,以后遇到其他的再补充。

方式一:ViewCompat.animate(view)

1、注册焦点变化监听

mBtnFocus1.setOnFocusChangeListener(this);

2、有焦点变化的时候进行放缩

@Override
public void onFocusChange(View view, boolean hasFocus) {switch (view.getId()) {case R.id.btn_focus1:if (hasFocus) {//获焦后放大1.2倍ViewCompat.animate(view).scaleX(1.2f).scaleY(1.2f).translationZ(1.2f).start();} else {//丢失焦点后缩回正常ViewCompat.animate(view).scaleX(1.0f).scaleY(1.0f).translationZ(1.0f).start();}}
}

方式二:StateListAnimator

1、res文件夹下新建animator文件夹,然后新建focus_scale_anim.xml文件。

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:state_focused="true"><set><objectAnimatorandroid:duration="@android:integer/config_shortAnimTime"android:propertyName="scaleX"android:valueTo="1.2"android:valueType="floatType" /><objectAnimatorandroid:duration="@android:integer/config_shortAnimTime"android:propertyName="scaleY"android:valueTo="1.2"android:valueType="floatType" /></set></item><item android:state_focused="false"><set><objectAnimatorandroid:duration="@android:integer/config_shortAnimTime"android:propertyName="scaleX"android:valueTo="1"android:valueType="floatType" /><objectAnimatorandroid:duration="@android:integer/config_shortAnimTime"android:propertyName="scaleY"android:valueTo="1"android:valueType="floatType" /></set></item>
</selector>

2、然后在xml布局文件中,把需要放缩的view加上该动画

<Buttonandroid:id="@+id/btn_focus3"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginLeft="50px"android:stateListAnimator="@animator/focus_scale_anim"android:text="focus3" />

3、或者在代码中实现也可以

StateListAnimator animator = AnimatorInflater.loadStateListAnimator(this, R.animator.focus_scale_anim);
mBtnFocus2.setStateListAnimator(animator);

上面分别用focus3和focus2分别用了xml和代码的方式,运行效果一致。

参考文章:

StateListAnimator的应用

http://www.yidumall.com/news/46037.html

相关文章:

  • 关于网站建设的论文提纲网站seo公司哪家好
  • 任丘网站开发建设怎么选软件开发公司排名
  • wordpress网站 app河南seo技术教程
  • 哪些公司经常做网站发布平台
  • 外贸局是做什么的工作陕西seo快速排名
  • 哪些网站是dz做的推广软件赚钱违法吗
  • 网站开发合同封面优化关键词排名推广
  • 山西网络网站建设销售公司常熟seo网站优化软件
  • 上海html5网站制作个人免费建站软件
  • 中国空间站离地球多远百度指数查询排行榜
  • 建设旅游网站的意义关键词推广优化外包
  • 做网站可以用别人的源码吗江门网站建设模板
  • 海外社交网络推广网站优化最为重要的内容是
  • 陕西做网站的公司电话3小时百度收录新站方法
  • 搭建网站百度高级搜索网址
  • icp网站负责人扬州seo推广
  • 建设网站可以赚钱吗百度代运营推广
  • 网站推广排名怎么做优化seo教程
  • 三级网站菜单栏建立一个网站需要花多少钱
  • 网站做链接操作步骤dy刷粉网站推广马上刷
  • 医疗美容手机网站建设百度登录入口官网
  • 怎么做一个自己的网站优化营商环境工作总结
  • 基于bbs的网站开发项目报告线下推广方式都有哪些
  • 深圳网站建设公司哪里好龙岗网站制作
  • 做网站需要的照片seo关键词排名价格
  • 如何做网站卖连接种子在线资源搜索神器
  • 网站和小程序的区别网络营销的功能有哪些?
  • wordpress改字体湖南网站seo地址
  • 网站建设前景如何百度权重排名
  • 例举一个"目录索引类搜索引擎"网站并将这个网站的url写在下方.百度seo推广计划类型包括