简体   繁体   English

图标未显示在Android Studio中的ActionBar上

[英]Icons do not appear on the ActionBar in the Android studio

hi there I try Make Material Design App Bar/ActionBar and Style It. 嗨,我尝试制作Material Design App Bar / ActionBar并设置样式。

I am noob .. I try do it with this tutorial 我是菜鸟..我尝试通过本教程进行操作

I do all steps...But for last step, I can not add icon to action bar. 我已完成所有步骤...但是对于最后一步,我无法在操作栏中添加图标。

I use android studio last version and test SDK is 17 我使用的是android studio最新版本,并且测试的SDK是17

    <item
        android:id="@+id/action_textsms"
        android:orderInCategory="200"
        android:title="textSMS"
        android:icon="@drawable/ic_action_textsms"
        app:showAsAction="ifRoom"
        ></item>
</menu>

But the icon do not appear in android studio on emaulator (android4.2.2) 但该图标未出现在emaulator(android4.2.2)上的android studio中

dose I define action_textsms correct? 我定义的action_textsms剂量正确吗? what is my wrong? 我怎么了

Check it out if in the styles.xml: 检查是否在styles.xml中:

<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

    <item name="colorPrimary">@color/primary</item>
    <item name="colorPrimaryDark">@color/primary_dark</item>
    <!-- Customize your theme here. -->
</style>

</resources>

and in the AndroidManifest.xml: 并在AndroidManifest.xml中:

<application
    ...
    android:theme="@style/AppTheme" >
...

app:showAsAction="ifRoom"更改为app:showAsAction="always"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM