Ranges for radius in shadowRadius and visiblity in TextView

孤街醉人 提交于 2019-12-11 02:02:14

问题


I'd like to know what is the exact range of the radius in the shadowRadius property. In the documentation, they only say this value must be a float. That's fine but what is the range for the radius in Android? I mean, how do I set a 120º radius for instance?

Same problem for the visibility for TextView. In the documentation, they say I have to set a #aarrggbb hexadecimal color code. That's fine but again, what is the range for the visibility in Android? The value 100 (= 64 in hexadecimal) doesn't correspond at all to a maximum opacity. So what are the minimum / maximum opacities in Android?


回答1:


Radius is a length not an angle and the range of opacity is 00 to FF using #aarrggbb.




回答2:


There is an undocumented range-limit on the shadowRadius property on some devices: 0-25.

If you exceed 25 on the Lenovo A3500 tablet for example, the following will show up in LogCat:

E/rsC++(14127): RS CPP error: Blur radius out of 0-25 pixel bound
E/rsC++(14127): RS CPP error (masked by previous error): Allocation creation failed
E/rsC++(14127): RS CPP error (masked by previous error): Allocation creation failed

And your app will terminate hard without throwing an exception that you could react to.

Gotta love the way Android handles these things...

(Also see this question: Android - Signal 11, RS CPP error: Blur radius out of 0-25 pixel bound)



来源:https://stackoverflow.com/questions/4866928/ranges-for-radius-in-shadowradius-and-visiblity-in-textview

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