THEONE10211024 / CircleIndicator

A lightweight viewpager indicator!
286 stars 88 forks source link

the customize widget can't display in the xml file #8

Open zhouqitong opened 8 years ago

zhouqitong commented 8 years ago

运行app 是正常的,但是在xml文件中无法正常显示,报错如下: “Rendering Problems onLayout error java.lang.IllegalStateException: forget to create movingItem?”

THEONE10211024 commented 8 years ago

这个需要在代码中attach到一个ViewPager才行,不然CircleIndicator并不知道有多少个item,参见https://github.com/THEONE10211024/CircleIndicator/issues/3

zhouqitong commented 8 years ago

但是每次调整xml布局的时候,必须先将该CircleIndicator 注释掉,才能预览整个xml布局效果,这样有点麻烦!不知道有没有好的解决办法!

THEONE10211024 commented 8 years ago

简单点的改法是在CircleIndicator.java 的layoutMovingItem()方法中用一个温和点的方式报错,而不是直接抛出异常,应该就可以