12313凯皇
2018-07-26
放在和layout同目录下
厉害了我的歌丶
2018-07-10
getSupportActionBar()
qq_忘记回忆_1
2018-05-01
照着视频,一点点敲就是了
一个没有情商的傻小子
2017-06-18
本地
2017-05-31
你试试viewpager能不能满足你 的要求
Rainie_174392641
2017-04-21
是不是遗漏了方法没有复写。
慕粉1536534692
2017-04-11
只能说代码与要实现的效果有出入
tskxc
2017-03-23
ActionBarDrawerToggle 是 DrawerLayout.DrawerListener实现。
和 NavigationDrawer 搭配使用,推荐用这个方法,符合Android design规范。
作用:
1.改变android.R.id.home返回图标。
2.Drawer拉出、隐藏,带有android.R.id.home动画效果。
3.监听Drawer拉出、隐藏;
做法,参照 NagatitionDrawer Demo。
重点在于:
/**
* When using the ActionBarDrawerToggle, you must call it during
* onPostCreate() and onConfigurationChanged()...
*/
@Override
protected void onPostCreate(Bundle savedInstanceState)
{
super.onPostCreate(savedInstanceState);
// Sync the toggle state after onRestoreInstanceState has occurred.
mDrawerToggle.syncState();
}
@Override
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
// Pass any configuration change to the drawer toggls
mDrawerToggle.onConfigurationChanged(newConfig);
}
以及 mDrawerToggle 的初始构造方法
mDrawerToggle = new ActionBarDrawerToggle(this, /* host Activity */
mDrawerLayout, /* DrawerLayout object */
R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
R.string.drawer_open, /* "open drawer" description for accessibility */
R.string.drawer_close /* "close drawer" description for accessibility */
)
最后不要忘了
mDrawerLayout.setDrawerListener(mDrawerToggle);
我不冻
2017-03-22
再看一遍老师讲解啊,
慕粉1007466055
2017-03-21
有几种方案可以考虑:
1,普通HTTP/HTTPS协议通讯.
2,基于HTTP协议的WEBSERVICE/SOAP方式通讯.
3,普通SOCKET方式自定义报文通讯.
慕村2598092
2017-03-10
不懂你要问什么
鲁彬
2017-02-20
private ActionBarDrawerToggle mActionBar;
//创建菜单控制开关
mActionBar = new ActionBarDrawerToggle(this, mDrawerLayout, new Toolbar(this), R.string.draw_open, R.string.draw_close) {
@Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
//当开了的时候显示标题
getSupportActionBar().setTitle(mTitle);
//初始化菜单选项
invalidateOptionsMenu();
}
@Override
public void onDrawerClosed(View drawerView) {
super.onDrawerClosed(drawerView);
getSupportActionBar().setTitle("请选择城市");
invalidateOptionsMenu();
}
};
你说的是这里的问题吧?你可一Ctrl+鼠标左键点开看看ActionBarDrawerToggle类的构造方法,看看里面穿的参数是什么,我的一开始也报错,后来我看了一下我那个里面穿的参数是个ToolBar类型的,所以我new了一个ToolBar,传一个this,就可以了,你可以先看一下传得是什么参数再做修改!
类类类
2017-01-14
MainActivity继承FragmentAcitvity. getFragmentManager()改成getSupportFragmentManager();
qy9999
2016-12-26
https://developer.android.com/training/implementing-navigation/nav-drawer.html?hl=zh-cn 这是官方文档地址,老师跟这个几乎一样。
爱慕者forever
2016-12-18
课程下载好像是以App为主
doitsolo
2016-12-08
解决了 继承ActionbarActivity 要用 getSupportActionBar