setRotation of TextView in RemoteViews (app widget)

前端 未结 1 1689
太阳男子
太阳男子 2021-01-27 11:57

I have a widget whose xml layout is simple: an ImageView and a TextView.

I can hardcode the rotation of the TextView in the xml by

相关标签:
1条回答
  • 2021-01-27 12:56

    The reason why you are crashing is because setRotation() does not have the @RemotableViewMethod annotation in the Android source code, and therefore it cannot be set using setFloat().

    I am not aware of any way for you to change the rotation property of a View dynamically in an app widget. One workaround is to support N rotations via N versions of your layout file, each of which has a hardcoded android:rotation value.

    0 讨论(0)
提交回复
热议问题