最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android TextSwitcher實(shí)現(xiàn)文字上下翻牌效果(銅板街)

 更新時(shí)間:2017年05月21日 17:40:29   作者:ganchuanpu  
這篇文章主要介紹了Android TextSwitcher實(shí)現(xiàn)文字上下翻牌效果(銅板街),需要的朋友可以參考下

tvNotice = (TextSwitcher)rootView.findViewById(R.id.tv_notice); 
 tvNotice.setFactory(new ViewSwitcher.ViewFactory() { 
  //這里 用來創(chuàng)建內(nèi)部的視圖,這里創(chuàng)建TextView,用來顯示文字 
   public View makeView() { 
    TextView tv =new TextView(getContext()); 
    //設(shè)置文字大小 
    tv.setTextSize(TypedValue.COMPLEX_UNIT_PX,getResources().getDimension(R.dimen.group_notice_font_size)); 
    //設(shè)置文字 顏色 
    tv.setTextColor(getResources().getColor(R.color.font_333333)); 
    return tv; 
   } 
  });  

然后自己可用timer或者Thread去控制輪播,輪播中控制tvNotice的代碼如下

// 設(shè)置切入動(dòng)畫 
tvNotice.setInAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.slide_in_bottom)); 
// 設(shè)置切出動(dòng)畫 
tvNotice.setOutAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.slide_out_up)); 
//items是一個(gè)字符串列表,index就是動(dòng)態(tài)的要顯示的items中的索引 
tvNotice.setText(itmes.get(index).getTitle()); 

slide_in_bottom.xml

<?xml version="1.0" encoding="utf-8"?> 
<set xmlns:android="http://schemas.android.com/apk/res/android" 
 android:fillAfter="true" 
 android:shareInterpolator="false" android:zAdjustment="top" 
 > 
 <translate 
  android:duration="1000" 
  android:fromYDelta="100%p" 
  android:toYDelta="0" /> 
</set> 

slide_out_up.xml

<?xml version="1.0" encoding="utf-8"?> 
<set xmlns:android="http://schemas.android.com/apk/res/android" 
 android:fillAfter="true" 
 android:shareInterpolator="false" android:zAdjustment="top" 
 > 
 <translate 
  android:duration="1000" 
  android:fromYDelta="0" 
  android:toYDelta="-100%p" /> 
</set> 

以上所述是小編給大家介紹的Android TextSwitcher實(shí)現(xiàn)文字上下翻牌效果(銅板街),希望對大家有所幫助,如果大家有任何疑問歡迎給我留言,小編會(huì)及時(shí)回復(fù)大家的,在此也非常感謝大家對腳本之家網(wǎng)站的支持! 

相關(guān)文章

最新評論

山东省| 哈尔滨市| 囊谦县| 湄潭县| 靖边县| 开江县| 尤溪县| 措美县| 广东省| 无棣县| 南雄市| 永泰县| 芦溪县| 哈尔滨市| 澳门| 石渠县| 务川| 昌吉市| 清涧县| 襄垣县| 旬阳县| 庐江县| 永胜县| 湄潭县| 秦皇岛市| 双流县| 南开区| 云浮市| 马鞍山市| 巴林左旗| 贺州市| 抚松县| 彭泽县| 赤水市| 夏河县| 和平县| 长治县| 江都市| 无为县| 宣城市| 龙川县|