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;
}
});
// 设置切入动画 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());
<?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>
<?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>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有