We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/**设置数据集合*/ 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(); 否者多次赋值后,再点击会出现闪退
The text was updated successfully, but these errors were encountered:
@XYRZX 刚查了调试了下代码,确实存在这个问题;谢谢大神指教,已修改代码。
Sorry, something went wrong.
No branches or pull requests
在setDatas方法上,加上 this.mViewFlipper.removeAllViews();
否者多次赋值后,再点击会出现闪退
The text was updated successfully, but these errors were encountered: