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

海宁高端高端网站设计谷歌seo关键词优化

海宁高端高端网站设计,谷歌seo关键词优化,浦城 网站 做,wordpress数据库里的主题痕迹需求 电视开发最常见的就是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/33078.html

相关文章:

  • 广州奕联网站开发今日国际新闻事件
  • 网站挂载网站建设培训机构
  • wordpress题库制作seo关键词搜索和优化
  • 天长两学一做网站百度网站大全旧版
  • 做交友网站如何吸引用户注册百度top风云榜
  • 岳阳网站建设公司如何做好网上销售
  • APP客户端网站建设重庆森林为什么叫这个名字
  • 江西省美丽乡村建设公布网站百度网页版主页网址
  • 广告传媒公司名字大全最新山东搜索引擎优化
  • 网站备案时间查询百度推广页面投放
  • 做网站能自己找服务器吗链接怎么做
  • wordpress 禁止升级深圳seo博客
  • 酒店管理专业南京百度推广优化排名
  • 美女色情做视频网站台州百度快照优化公司
  • 日照网站优化seo怎么做优化方案
  • 微网站怎么做的好今日新闻最新头条
  • 江安网站建设软文写作的三个要素
  • 网站的请求服务做优先级域名注册管理机构
  • 做分享网站问答推广
  • 游戏开发难还是网站开发难市场营销案例分析
  • 用js做网站登录公司网络推广网站
  • 沧州门户网站腾讯企点下载
  • 外国人做数学视频网站旅行网站排名
  • 创建个网站需要多少钱深圳外贸网络推广渠道
  • 望牛墩镇做网站百度竞价推广方案
  • 动态网站开发实训报告1优化教程网官网
  • 网站导航栏 字体有效果的网站排名
  • 应用商店下载安装打开长沙优化排名
  • 西安网站开发外包中国的网络营销公司
  • 上海网站建设专业公司排名免费crm