Is it possible to Implement Toggle Button in Action Menu Item using Actionbar sherlock in android

后端 未结 4 2021
栀梦
栀梦 2021-02-04 02:30

I have an app, which have toggle button in action menu item, though i\'m using Actionbar Sherlock, I don\'t know, how to place the toggle button in the action menu item. I don\'

4条回答
  •  忘了有多久
    2021-02-04 03:12

    If like me the actionLayout isn't working for you, try app:actionLayout="@layout/actionbar_service_toggle" instead of android:actionLayout="@layout/actionbar_service_toggle" as well as app:showAsAction="always" instead of android:showAsAction="always" This is because if you use appCompat the android namespace won't be used.

    So here's the final version:

    
      
    
    

    and

    
    
           
    
    

提交回复
热议问题