Android setDisplayHomeAsUpEnabled显示箭头而不是左插入符号

Android setDisplayHomeAsUpEnabled显示箭头而不是左插入符号,android,Android,我想在“活动”中显示“向上”按钮,功能正常,但无法显示左插入符号。相反,它显示了一个丑陋的后箭头。我在我的活动中这样做- public class SecondActivity extends ActionBarActivity{ @Override protected void onCreate(Bundle savedInstanceState) { mToolbar = (Toolbar) findViewById(R.id.toolbar); setS

我想在“活动”中显示“向上”按钮,功能正常,但无法显示左插入符号。相反,它显示了一个丑陋的后箭头。我在我的活动中这样做-

public class SecondActivity extends ActionBarActivity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {

    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(mToolbar);
    setTitle(getString(R.string.second));
    mToolbar.setTitleTextColor(getResources().getColor(android.R.color.white));

    ....
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    ....

   }
}
但我看到的只是-

这是布局xml-

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="org.step.main.SecondActivity">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/listsecond"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingTop="?attr/actionBarSize"
        android:clipToPadding="false"
        tools:context=".SecondActivity"
        />

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"/>

</FrameLayout>

有什么建议吗?另外,是否有办法将后退按钮的颜色更改为白色

注意:我使用的是theme-
theme.AppCompat.Light.NoActionBar
下面,您可以使任何图标显示为白色

至于左克拉图标,请看一看,它描述了在需要下载的目录中找到它的位置

编辑:您想要的图标位于
操作栏图标/holo\u深色/02\u导航\u上一个\u项目/

要将左箭头显示为白色,请执行以下操作:

    mToolbar.setTitleTextColor(getResources().getColor(android.R.color.white));
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    //Add the following code to make the up arrow white:
    final Drawable upArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
    upArrow.setColorFilter(getResources().getColor(android.R.color.white), PorterDuff.Mode.SRC_ATOP);
    getSupportActionBar().setHomeAsUpIndicator(upArrow);
请注意,您需要添加以下导入:

import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;

你能展示你的
工具栏
xml吗?在上面添加了布局xml。看看这个,可能会有帮助:它们对我都不起作用。啊,刚刚找到了答案。您只需调用
getSupportActionBar().setHomeAsUpIndicator(R.drawable.your_custom_image)当我测试它时,我能够让它显示
ic_启动器
。看看这个:这是用来把颜色改成白色的。但我的主要问题是显示左插入符号。是否有任何预先指定的绘图功能,或者我需要创建自己的绘图功能?@Sam我刚刚更新了答案,下载了操作栏图标包,链接的答案解释了在哪里可以找到它们。我从行动包中下载并添加了之前的全息黑暗主题中的ic_action_项目,即白色图像。谢谢。@Sam,我也看到了。更新了答案,以防万一这可以帮助其他人在未来!