我有简单的代码来创建简单的导航抽屉,但是当我为ActionBarDrawerToggle声明参数时,它表示无法应用drawable图标...
Gradle Massages Build
Error:(36, 26) error: no suitable constructor found for
ActionBarDrawerToggle(MainActivity,DrawerLayout,int,int,int)
constructor ActionBarDrawerToggle.ActionBarDrawerToggle(Activity,DrawerLayout,Toolbar,int,int) is
not applicable
(argument mismatch; int cannot be converted to Toolbar)
constructor ActionBarDrawerToggle.
<T>ActionBarDrawerToggle(Activity,Toolbar,DrawerLayout,T,int,int) is not applicable
(cannot infer type-variable(s) T
(actual and formal argument lists differ in length))
where T is a type-variable:
T extends Drawable,DrawerToggle declared in constructor
<T>ActionBarDrawerToggle(Activity,Toolbar,DrawerLayout,T,int,int)
Run Code Online (Sandbox Code Playgroud)
我不知道我做错了什么,我看到支持/ v7/widget/Toolbar和ActionBarDrawerToggle但没有帮助
这是我的导入支持库
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.view.Menu;
import android.view.MenuItem;
import …Run Code Online (Sandbox Code Playgroud) android android-appcompat android-studio navigation-drawer build.gradle