国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

大于二高端網(wǎng)站建設(shè)新手seo入門教程

大于二高端網(wǎng)站建設(shè),新手seo入門教程,免費(fèi)crm軟件大全,電商主題wordpress需求 電視開發(fā)最常見的就是view獲焦后要有放大效果,讓用戶明顯看到。這里總結(jié)兩個實現(xiàn)方法,以后遇到其他的再補(bǔ)充。 方式一:ViewCompat.animate(view) 1、注冊焦點變化監(jiān)聽 mBtnFocus1.setOnFocusChangeListener(this);2、有焦點變化的時…

需求

電視開發(fā)最常見的就是view獲焦后要有放大效果,讓用戶明顯看到。這里總結(jié)兩個實現(xiàn)方法,以后遇到其他的再補(bǔ)充。

方式一:ViewCompat.animate(view)

1、注冊焦點變化監(jiān)聽

mBtnFocus1.setOnFocusChangeListener(this);

2、有焦點變化的時候進(jìn)行放縮

@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、或者在代碼中實現(xiàn)也可以

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

上面分別用focus3和focus2分別用了xml和代碼的方式,運(yùn)行效果一致。

參考文章:

StateListAnimator的應(yīng)用

http://aloenet.com.cn/news/43216.html

相關(guān)文章:

  • 網(wǎng)站標(biāo)簽怎么做重慶網(wǎng)站網(wǎng)絡(luò)推廣
  • 淄博北京網(wǎng)站建設(shè)手機(jī)百度搜索引擎入口
  • 做網(wǎng)站收費(fèi)標(biāo)準(zhǔn)哪個平臺可以免費(fèi)打廣告
  • 網(wǎng)站在建設(shè)時不容忽略的一些細(xì)節(jié)最權(quán)威的排行榜網(wǎng)站
  • 網(wǎng)站建設(shè)中模板下載武漢百度開戶代理
  • 百度搜索不到asp做的網(wǎng)站天津搜狗seo推廣
  • 網(wǎng)站建設(shè)哪個空間比較好網(wǎng)站怎么優(yōu)化到首頁
  • 上海簡站商貿(mào)有限公司seo基礎(chǔ)理論
  • 做任務(wù)傭金網(wǎng)站源碼互聯(lián)網(wǎng)營銷培訓(xùn)平臺
  • 公眾號編輯 wordpress魔貝課凡seo
  • 聚美優(yōu)品網(wǎng)站怎么做的最新的即時比分
  • 白糖貿(mào)易怎么做網(wǎng)站廈門seo公司到1火星
  • 外貿(mào)網(wǎng)站建設(shè)設(shè)計杭州做seo的公司
  • 微信h5免費(fèi)制作網(wǎng)站seo優(yōu)化與推廣招聘
  • 招聘網(wǎng)站怎么做營銷軟文代寫平臺
  • 個人網(wǎng)站可以做淘寶客杭州網(wǎng)站推廣平臺
  • 商城網(wǎng)站建站深圳優(yōu)化seo排名
  • 如果做鏡像網(wǎng)站360廣告投放平臺
  • 北京的網(wǎng)站設(shè)計公司線上營銷策劃方案
  • 重慶做網(wǎng)站微信的公司提高搜索引擎檢索效果的方法
  • 郴州seo快速排名關(guān)鍵詞優(yōu)化排名工具
  • 重慶市建設(shè)工程信息網(wǎng)一體化平臺河源市企業(yè)網(wǎng)站seo價格
  • 手機(jī)網(wǎng)站排名優(yōu)化軟件網(wǎng)絡(luò)營銷推廣方式都有哪些
  • 遼寧省網(wǎng)站制作公司排名怎樣在百度發(fā)廣告貼
  • html5網(wǎng)站優(yōu)點優(yōu)化推廣網(wǎng)站怎么做最好
  • 鄭州網(wǎng)站建設(shè)培訓(xùn)短期班營銷推廣怎么做
  • ??谧鼍W(wǎng)站10大品牌優(yōu)化大師使用心得
  • 淘客優(yōu)惠券推廣網(wǎng)站怎么做客戶營銷
  • 阿里云怎么做網(wǎng)站滄浪seo網(wǎng)站優(yōu)化軟件
  • 學(xué)完html怎么做網(wǎng)站網(wǎng)絡(luò)營銷工程師培訓(xùn)