chessluo / textbannerview Goto Github PK
View Code? Open in Web Editor NEW一个Android文字轮播控件,又名跑马灯;已经实现了可垂直跑、可水平跑的跑马灯,几行代码集成!
License: Apache License 2.0
一个Android文字轮播控件,又名跑马灯;已经实现了可垂直跑、可水平跑的跑马灯,几行代码集成!
License: Apache License 2.0
获取当前显示的textview中的信息
跳到其他界面,回来的时候轮播停止了
用带图的setDatasWithDrawableIcon方法之后 默认内容是居中的。布局文件里的setGravity=left不起作用了。
按照作者你的方法,我在fragment中的 onStop和 onResume方法中,分别调用了停用和启动的api,但是我切换到其他的fragment后,过不久再返回这个fragment,banner一下子会重叠了很多数据
/**设置数据集合*/
public void setDatas(List<String> datas){
this.mDatas = datas;
this.mViewFlipper.removeAllViews();
if (DisplayUtils.notEmpty(mDatas)){
for (int i = 0; i < mDatas.size(); i++) {
TextView textView = new TextView(getContext());
textView.setText(mDatas.get(i));
//任意设置你的文字样式,在这里
textView.setSingleLine(isSingleLine);
textView.setTextColor(mTextColor);
textView.setTextSize(mTextSize);
textView.setGravity(mGravity);
mViewFlipper.addView(textView,i);//添加子view,并标识子view位置
}
}
}
在setDatas方法上,加上 this.mViewFlipper.removeAllViews();
否者多次赋值后,再点击会出现闪退
四个Fragment, 轮播放在第三个里。 切换123都没问题,切换到第四个再回来,轮播貌似还在继续,但是轮播到下一个就会丢失。
setTextDirection()根本没有竖直方向的属性
希望能在xml中设置多行轮播文字的行间距
1.Activity a中使用textbannerview,跳转至b,在返回a时,文字会出现重叠
2.单个标题依旧可以轮播,查看api未找到合适的解决办法
3.字体间距
4.自定义字体
感谢开发者提供的控件,希望开发者能看到这些问题,感谢
两条消息间隔太短,可能会重叠的情况
/*设置数据集合/
public void setDatas(List datas){
this.mDatas = datas;
if (DisplayUtils.notEmpty(mDatas)){
mViewFlipper.removeAllViews();
for (int i = 0; i < mDatas.size(); i++) {
TextView textView = new TextView(getContext());
setTextView(textView,i);
mViewFlipper.addView(textView,i);//添加子view,并标识子view位置
}
}
}
这个逻辑是错误的,如果开始有数据,重新设置一个无数据的,这个就没有办法刷新,可能开始就没有考虑过这种情况吧
Originally posted by @Trammels in #4 (comment)
android.widget.AdapterViewFlipper
谢谢大佬
??
这样可以定制字体了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.