Comments (6)
参照demo的使用方式,也还是会报该异常
from toastx.
有复现的代码吗?我用Java测试没有复现这个问题
from toastx.
感谢您的回复。
View toastRoot = LayoutInflater.from(MainActivity.this).inflate(R.layout.custom_ruler_layout, null);
TextView tvToastText = (TextView) toastRoot.findViewById(R.id.toast_text);
TextView textJump = (TextView) toastRoot.findViewById(R.id.textJump);
textJump.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {}
}
ToastX.with(MainActivity.this)
.customizeView(toastRoot)
.animationMode(ToastX.ANIM_MODEL_SLIDE) //动画模式 弹出或者渐变
.position(ToastX.POSITION_BOTTOM) //显示的位置 顶部或者底部
.duration(3000) //显示的时间 单位ms
.show();
调用代码如上所示。我新开的项目使用没有啥问题,在一个老项目上调用就会报上面的类型转换错误。
from toastx.
可以尝试在您的老项目上用下Design库的Snackbar。看是否表现正常。本库就是基于Snackbar改的。如果直接使用Snackbar表现正常的话 看能否提供可以复现的demo
from toastx.
在华为平板 MRR-W29上 会出现这个错误
from toastx.
我也碰到这样的情况,根据调试走到了这里:
final SnackbarContentLayout content =SnackbarContentLayout)
inflater.inflate( hasSnackbarContentStyleAttrs(context) ? R.layout.mtrl_layout_snackbar_include : R.layout.design_layout_snackbar_include, parent, false);
final Snackbar snackbar = new Snackbar(context, parent, content, content);
hasSnackbarContentStyleAttrs(context) 的值为false,所以取R.layout.design_layout_snackbar_include这个布局,然后就使用系统的snackar,然后就报了类型转换异常
@yinshuai0324 没太懂这里的逻辑,麻烦大佬有时间看看?
from toastx.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toastx.