简体   繁体   English

Android:ActionBar项目动画

[英]Android: ActionBar Item Animation

I want to apply a rotate Animation to an action in my ActionBar . 我想将旋转动画应用于ActionBar的动作。 For the ActionBar I´m using ActionBarSherlock. 对于ActionBar我正在使用ActionBarSherlock。

My problem is, that in all Solutions I found (eg Animated Icon for ActionItem ) they are getting the MenuItem which shall be animated in onOptionsItemSelected(MenuItem item) . 我的问题是,在我找到的所有解决方案中(例如ActionItem的动画图标 ),他们都在获取MenuItem ,该MenuItem应该在onOptionsItemSelected(MenuItem item)进行动画处理。

But I want to be able to start the animation even BEFORE some action is selected. 但是我希望即使在选择某些动作之前也可以开始动画。 So how can I get the MenuItem ? 那么,如何获得MenuItem呢?

在提供给onCreateOptionsMenu()Menu上调用findItem() onCreateOptionsMenu()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM