在Android中更改汉堡包图标

时间:2016-01-19 12:16:04

标签: android navigation-drawer drawer hamburger-menu

我想更换汉堡图标并将其替换为任何其他自定义图标。 我怎样才能做到这一点?这可行吗?

我选择了android.support.v7 Toolbar & DrawerLayout- how to change Hamburger icon,但它对我没用。

2 个答案:

答案 0 :(得分:2)

尝试这样做

> locfit.regression
[[1]]
Call:
locfit(formula = SD ~ Tmean + Elevation + Longitude + Latitude, 
    data = data.frame(station.means[[i]]), alpha = 0.3, maxk = 150)

Number of observations:          589 
Family:  Gaussian 
Fitted Degrees of freedom:       126.789 
Residual scale:                  13.7 

[[2]]
Call:
locfit(formula = SD ~ Tmean + Elevation + Longitude + Latitude, 
    data = data.frame(station.means[[i]]), alpha = 0.3, maxk = 150)

Number of observations:          589 
Family:  Gaussian 
Fitted Degrees of freedom:       120.128 
Residual scale:                  16.8 

[[3]]
Call:
locfit(formula = SD ~ Tmean + Elevation + Longitude + Latitude, 
    data = data.frame(station.means[[i]]), alpha = 0.3, maxk = 150)

Number of observations:          589 
Family:  Gaussian 
Fitted Degrees of freedom:       130.268 
Residual scale:                  19.7 

[[4]]
Call:
locfit(formula = SD ~ Tmean + Elevation + Longitude + Latitude, 
    data = data.frame(station.means[[i]]), alpha = 0.3, maxk = 150)

Number of observations:          589 
Family:  Gaussian 
Fitted Degrees of freedom:       224.139 
Residual scale:                  26.2 

[[5]]
Call:
locfit(formula = SD ~ Tmean + Elevation + Longitude + Latitude, 
    data = data.frame(station.means[[i]]), alpha = 0.3, maxk = 150)

Number of observations:          589 
Family:  Gaussian 
Fitted Degrees of freedom:       165.967 
Residual scale:                  9.62 

[[6]]
Call:
locfit(formula = SD ~ Tmean + Elevation + Longitude + Latitude, 
    data = data.frame(station.means[[i]]), alpha = 0.3, maxk = 150)

Number of observations:          589 
Family:  Gaussian 
Fitted Degrees of freedom:       142.575 
Residual scale:                  4.07 

[[7]]
Call:
locfit(formula = SD ~ Tmean + Elevation + Longitude + Latitude, 
    data = data.frame(station.means[[i]]), alpha = 0.3, maxk = 150)

Number of observations:          589 
Family:  Gaussian 
Fitted Degrees of freedom:       154.888 
Residual scale:                  3.1 

[[8]]
Call:
locfit(formula = SD ~ Tmean + Elevation + Longitude + Latitude, 
    data = data.frame(station.means[[i]]), alpha = 0.3, maxk = 150)

Number of observations:          589 
Family:  Gaussian 
Fitted Degrees of freedom:       196.975 
Residual scale:                  2.35 

[[9]]
Call:
locfit(formula = SD ~ Tmean + Elevation + Longitude + Latitude, 
    data = data.frame(station.means[[i]]), alpha = 0.3, maxk = 150)

Number of observations:          589 
Family:  Gaussian 
Fitted Degrees of freedom:       261.399 
Residual scale:                  2.22 

[[10]]
Call:
locfit(formula = SD ~ Tmean + Elevation + Longitude + Latitude, 
    data = data.frame(station.means[[i]]), alpha = 0.3, maxk = 150)

Number of observations:          589 
Family:  Gaussian 
Fitted Degrees of freedom:       203.036 
Residual scale:                  3.06 

[[11]]
Call:
locfit(formula = SD ~ Tmean + Elevation + Longitude + Latitude, 
    data = data.frame(station.means[[i]]), alpha = 0.3, maxk = 150)

Number of observations:          589 
Family:  Gaussian 
Fitted Degrees of freedom:       124.166 
Residual scale:                  6.18 

[[12]]
Call:
locfit(formula = SD ~ Tmean + Elevation + Longitude + Latitude, 
    data = data.frame(station.means[[i]]), alpha = 0.3, maxk = 150)

Number of observations:          589 
Family:  Gaussian 
Fitted Degrees of freedom:       131.724 
Residual scale:                  10.3 

答案 1 :(得分:1)

使用此代码

ActionBarDrawerToggle mDrawerToggle = new ActionBarDrawerToggle(this,
                 mDrawerLayout, null, your_drawable, your_drawable);

参考此链接: How to replace the hamburger icon used for ActionBarToggle on Android Toolbar with a custom drawable?

或者,您可以使用:

mDrawerToggle.setDrawerIndicatorEnabled(false);
mDrawerToggle.setHomeAsUpIndicator(drawable_name);