action button" android:showAsAction" not work
2014-07-14 17:44
351 查看
If your app is using the Support Library for
compatibility on versions as low as Android 2.1,
the
is not available from the
Instead this attribute is provided by the Support Library and you must define your own XML namespace and use that namespace as the attribute prefix. (A custom XML namespace should be based on your app name, but it can be any name you want and is only accessible
within the scope of the file in which you declare it.)
For example:
好吧~~
compatibility on versions as low as Android 2.1,
the
showAsActionattribute
is not available from the
android:namespace.
Instead this attribute is provided by the Support Library and you must define your own XML namespace and use that namespace as the attribute prefix. (A custom XML namespace should be based on your app name, but it can be any name you want and is only accessible
within the scope of the file in which you declare it.)
For example:
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:yourapp="http://schemas.android.com/apk/res-auto" > <!-- Search, should appear as action button --> <item android:id="@+id/action_search" android:icon="@drawable/ic_action_search" android:title="@string/action_search" yourapp:showAsAction="ifRoom" /> ... </menu>
好吧~~
相关文章推荐
- android:showAsAction="never"报错
- 为什么我的 app:actionViewClass="android.widget.SearchView"和app:showAsAction="ifRoom|collapseActionView"才有
- android:showAsAction = "never"那么这句话是做什么用的呢
- Android 开发 Tip 10 -- app:showAsAction & android:showAsAction
- showAsAction="always"报错
- android:showAsAction="always|withText"分析
- 在ActionBar中,即便设置showAsAction="always",items仍然在overflow中显示的问题
- app:showAsAction=""与android:showAsAction=""的区别
- xml文件中 android:showAsAction = " " 的作用
- <style name="Base.Widget.AppCompat.ActionButton" parent="android:Widget.Material.Acti
- 在ActionBar中,即便设置showAsAction="always",items仍然在overflow中显示的问题...
- 为什么我的 app:actionViewClass="android.widget.SearchView"和app:showAsAction="ifRoom|collapseActionView"才有
- 3月23日学习记录(showAsAction,android:orderInCategory="100")
- android studio <item/>标签下不能使用showAsAction属性
- android:showAsAction 在Android studio 不起作用
- android:showAsAction的用法
- 在ActionBar中,即便设置showAsAction="always",items仍然在overflow中显示的问题
- Android——showAsAction()
- 去掉Actionbar左侧的图标<style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar"> <it
- Android Edittext设置android:imeOptions="actionSearch"不起作用