相关疑难解决方法(0)

ActionBar中动画ActionBarDrawerToggle的颜色

如何使用AppCompat-v7(v21)更改ActionBar中动画ActionBarDrawerToggle图标的颜色?我尝试过这个,但是没有用.谢谢.

myActionBarActivity.java

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

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mLeftDrawer = (LinearLayout) findViewById(R.id.left_drawer);

    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
            R.string.drawer_open, R.string.drawer_close)
Run Code Online (Sandbox Code Playgroud)

价值观/ styles.xml

    <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
Run Code Online (Sandbox Code Playgroud)
    <style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
        <item name="spinBars">true</item>
        <item name="color">@android:color/black</item>
    </style>
Run Code Online (Sandbox Code Playgroud)

更新:解决了,<item name="actionBarWidgetTheme">我的主题中有这个条目可能重叠 <item name="drawerArrowStyle">.我删除了它,现在一切正常.

android-appcompat android-5.0-lollipop

16
推荐指数
3
解决办法
7129
查看次数

如何在android studio中更改导航抽屉的汉堡图标的颜色?

我用默认导航抽屉创建了一个新活动,但默认颜色是黑色,如何更改?

在此处输入图片说明

我试过这段代码有效,但动画没有运行,无法点击

Drawable drawable = getResources().getDrawable(R.drawable.ic_menu);
        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
        drawer.addDrawerListener(toggle);
        toggle.syncState();

        NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
        navigationView.setNavigationItemSelectedListener(this);
Run Code Online (Sandbox Code Playgroud)

android android-studio navigation-drawer android-toolbar android-studio-3.0

3
推荐指数
1
解决办法
5137
查看次数