4
A
回答
5
0
除了加布裏埃萊馬里奧蒂的答案。
你可能會嘗試用他提到的庫替換android.R.id.home和ActionView
。
查找視圖,並替換:
private void replaceHomeView(Activity activity){
View homeView;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
Resources resources = activity.getResources();
int id = resources.getIdentifier("android:id/home", null, null);
homeView = activity.getWindow().getDecorView().findViewById(id);
} else {
homeView = activity.getWindow().getDecorView().findViewById(R.id.home);
}
replace(homeView);
}
卸下並更換主圖標ImageView
:
private replace(View home){
ViewGroup parent = (ViewGroup) view.getParent();
int homeIndex = parent.indexOfChild(view);
ActionView newHome = new ActionView(home.getContext));
newHome.setId(home.getId());
parent.removeView(home);
parent.addView(newHome, homeIndex);
}
注:我沒有這個測試自己。
4
我已經使用balysv/material-menu庫併成功實施。
ActionView By Markushi要求API級別14+但通過balysv材料菜單可以與ActionBarSherLock
使用也與動畫定製。
在這裏,你有四個圖標狀態:
BURGER,ARROW,X,檢查。對於導航抽屜,您可以使用(X,CHECK)進行刪除操作並使用(BURGER,ARROW)。
還有一個功能,我喜歡的是壓圓動畫。在這裏,我們可以選擇按壓圓形動畫和非按壓圓形動畫。
您可以完全控制動畫,同時滑動這樣的抽屜,
3
Android的支持庫V7的ActionBarDrawerToggle有動畫。
https://developer.android.com/reference/android/support/v7/app/ActionBarDrawerToggle.html
下面是支持庫V7添加到項目中的指令。 https://developer.android.com/tools/support-library/setup.html
相關問題
- 1. 材質設計動畫
- 2. 更改材質設計AppCompat ActionBar顏色
- 3. Lollopop前的Android材質設計動畫
- 4. 材質設計動畫打開表格
- 5. Android材質設計 - 材質動作
- 6. 關於custome的材質設計活動動畫onClick事件ListView
- 7. Android的工具欄/支持ActionBar的材質設計
- 8. 如何在材質設計的ActionBar下獲得進度條?
- 9. 如何在動畫材質設計中使用卡片
- 10. 在ListView中選擇ImageCell時的材質設計動畫
- 11. 材質設計 - 浮動EditText實現
- 12. Angular2材質設計動態標籤
- 13. Google動態頁面材質設計
- 14. Angularjs JQuery的材質設計
- 15. 材質設計inish懸停
- 16. 支持Android材質設計
- 17. 榆木0.18材質設計
- 18. 鈦合金材質設計
- 19. 材質設計,對網絡
- 20. Android材質設計錯誤
- 21. HTML材質設計按鈕
- 22. 材料設計中彈出的ActionBar
- 23. jquery材質弧運動動畫
- 24. Android材質設計活動退出動畫顯示白色屏幕
- 25. KitKat上的Android材質設計4.4
- 26. 自定義材質設計工具欄
- 27. 材質設計燈光瀑布頭
- 28. Android材質設計 - LinearLayout標高
- 29. angularjs材質設計和彈性佈局
- 30. 根據材質設計規範