Thursday 15 September 2011

android - ActionBar - Using a View as icon -


So, I want to use a view in place of the app icon in the taskbar. I can not use a simple image because the view will change its color according to the set of colors selected in the parameter of the app (and I do not want to create four hundred images in Photoshop ...).

I know that I can use a custom view for the action bar and it is also easy, but the problem is that the original app image is still showing up. I also know that I can hide it by setting false to setDisplayShowHomeEnabled , but it also hides the glyph of my navigation drawer and this is the problem.

I also override a custom drauble and odreid method but nothing was shown and the 1px height / width in the dracula.

You can use a transparent to hide the icon, just as you would for your verb Use that style to edit:

  & lt; Style name = "myActionBarStyle" parent = "@ style / widget.Sherlock.Light .ActionBar" & gt; & Lt; Item name = "icon" & gt; @Android: Color / Transparent & lt; / Item & gt; & Lt; / Style & gt;   

Let's say that you use your code in the form of a style named MyActionBarStyle for your actionbase.

  & lt; Style name = "AppBaseTheme" parent = "@ style / theme.Sherlock.Light" & gt; & Lt; Item name = "actionbars" & gt; @Style / MyWestBarstyle & lt; / Item & gt; & Lt; / Style & gt;    

No comments:

Post a Comment