第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

ActionBarDrawerToggle第三個(gè)參數(shù)代表的是什么

new?ActionBarDrawerToggle對(duì)象那個(gè)時(shí),第三個(gè)參數(shù)代表的是什么

正在回答

1 回答

ActionBarDrawerToggle ?是?DrawerLayout.DrawerListener實(shí)現(xiàn)。

和 NavigationDrawer 搭配使用,推薦用這個(gè)方法,符合Android design規(guī)范。

作用:

1.改變android.R.id.home返回圖標(biāo)。

2.Drawer拉出、隱藏,帶有android.R.id.home動(dòng)畫效果。

3.監(jiān)聽Drawer拉出、隱藏;


做法,參照 NagatitionDrawer Demo。

重點(diǎn)在于:


/**

? * 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 的初始構(gòu)造方法

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);


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

ActionBarDrawerToggle第三個(gè)參數(shù)代表的是什么

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)