国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Android > 正文

Android TextSwitcher實現文字上下翻牌效果(銅板街)

2019-10-23 18:28:25
字體:
來源:轉載
供稿:網友

 

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

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

// 設置切入動畫 tvNotice.setInAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.slide_in_bottom)); // 設置切出動畫 tvNotice.setOutAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.slide_out_up)); //items是一個字符串列表,index就是動態的要顯示的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,上下翻牌

以上所述是小編給大家介紹的Android TextSwitcher實現文字上下翻牌效果(銅板街),希望對大家有所幫助,如果大家有任何疑問歡迎給我留言,小編會及時回復大家的,在此也非常感謝大家對VEVB武林網網站的支持! 

 

注:相關教程知識閱讀請移步到Android開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 巴彦县| 广安市| 普定县| 康定县| 衡山县| 张北县| 扶沟县| 凉城县| 贡嘎县| 宝应县| 淮滨县| 衡山县| 铜鼓县| 鹤峰县| 玉树县| 淄博市| 亳州市| 南陵县| 元江| 江油市| 洛宁县| 磐石市| 若尔盖县| 淮安市| 古蔺县| 清镇市| 拉萨市| 基隆市| 牙克石市| 万载县| 景德镇市| 绥江县| 怀化市| 邹城市| 江都市| 六盘水市| 富裕县| 建德市| 巴南区| 皋兰县| 喀什市|