我想在我的应用程序中实现ActionBarSherlock侧面菜单导航抽屉,但总是得到:
DrawerLayout cannot be resolved to a type ActionBarDrawerToggle cannot be resolved to a type
我的进口是:
import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.MenuItem;
解决方法
从支持库导入这些
import android.support.v4.app.ActionBarDrawerToggle; import android.support.v4.widget.DrawerLayout;
检查一下
http://developer.android.com/tools/support-library/index.html
有关NaigationDrawer的更多信息
http://developer.android.com/training/implementing-navigation/nav-drawer.html