Friday 15 March 2013

app:showAsAction vs android:showAsAction -



app:showAsAction vs android:showAsAction -

i building android app , want have button visible on actionbar. followed this guide , others, none of them seem solve problem (although close guess...).

i have bundle "app" , utilize app:showasaction="always". no error shown, no button on bar well. when alter android:showasaction="always" button appears on bar, androidstudio tells me should go "app:showasaction appcompat...".

i have custom theme parent="@android:style/theme.holo.light.darkactionbar"> , bar itself: parent="@android:style/widget.holo.light.actionbar.solid.inverse">.

should alter , app:showasaction working, or ignore androidstudio error message , go android:showasaction?

this documentation of lint rule:

appcompatresource

summary: menu namespace

priority: 5 / 10

severity: error

category: usability

when using appcompat library, menu resources should refer showasaction in app: namespace, not android: namespace.

similarly, when not using appcompat library, should using android:showasaction attribute.

i think problem mixing framework activity , appcompat menu.

you should utilize appcompatactivity appcompat action bar , app:showasaction; or activity android:showasaction.

android android-actionbar android-studio

No comments:

Post a Comment