PropertyValuesHolder: Couldn't find setter/getter for property <property-name> with value type float

别来无恙 提交于 2020-01-14 03:41:07

问题


I am facing the following issue when I am using PropertyValuesHolder.ofFloat(....)

PropertyValuesHolder: Couldn't find setter/getter for property < Property-name > with value type float

Other wise it is working good if I replace .ofFloat(...) to ofInt(....)

By using ofInt(....), the animation is not animating smoothly.

I am also checked for solution posted PropertyValuesHolder: Couldn't find setter/getter for property alpha with value type float

But this solution won't work for me since I am applying the animation to the custom drawable.

Can and one explain what is reason for this error while using ofFloat(....). And what would be the alternate solution of this. Thanks in Advance.


回答1:


Same problem here.

Solved that way:

final ObjectAnimator animScrollToBottom = ObjectAnimator.ofInt(AnimatorProxy.wrap(scrollView), "scrollY", fromPositionInt, toPositionInt).setDuration(500);

or with float values:

final ObjectAnimator animScrollToBottom = ObjectAnimator.ofFloat(scrollView, "y", fromPositionInt,toPositionInt).setDuration(500);


来源:https://stackoverflow.com/questions/17563973/propertyvaluesholder-couldnt-find-setter-getter-for-property-property-name-w

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!