由网友(别欢)分享简介:我怎么能dinamically修改的操作栏操作按钮图标当我在刷卡 ViewPager 片段。根据片段按钮必须改变状态(图标)。How i can dinamically change action button icon of Action Bar when i swipe fragments in ViewPage...
我怎么能dinamically修改的操作栏操作按钮图标
当我在刷卡 ViewPager
片段。根据片段按钮必须改变状态(图标)。
How i can dinamically change action button icon of Action Bar
when i swipe fragments in ViewPager
. Depending on fragment button must change state (icon).
推荐答案
我解决了这个问题:
1)我实施 OnPageChangeLister
2)调用的setIcon()
在 onPageScrollStateChanged()
3)菜单项
像全局变量定义(类字段)
I solved this problem:
1) I implement OnPageChangeLister
2) Invoke setIcon()
in onPageScrollStateChanged()
3) MenuItem
defined like global variable (field of class)
相关推荐
最新文章