1

是否可以在材質設計中製作導航抽屜,就像低端API上的Gmail應用程序一樣? 如果可能有任何人有教程或指導來做到這一點? 感謝Android材質設計降低API的導航抽屜

+0

題外話,太寬泛,也不清楚你要問什麼,所有,同時,在一個問題...格拉茲 – Selvin 2015-01-15 17:34:18

+0

抱歉,但蘭吉思瞭解它:)和你我想創建一個導航抽屜在Matreial設計工作在較低的Android版本,如Android 4.0或2.3。 – Erdnuss 2015-01-16 16:31:41

回答

1

使用程序兼容性庫吧,這裏有一個鏈接如何設置它:http://android-developers.blogspot.in/2014/10/appcompat-v21-material-design-for-pre.html

您需要使用的工具欄來顯示arrowToggle:

<android.support.v7.widget.Toolbar 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:id="@+id/toolbar" 
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
android:minHeight="?attr/actionBarSize" 
android:background="?attr/colorPrimary" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content"/> 

而在你MAINVIEW你需要要補充一點:

setContentView(R.layout.guidelib_activity_main); 
mToolbar = (Toolbar)findViewById(R.id.toolbar); 
setSupportActionBar(mToolbar); 
getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
getSupportActionBar().setHomeButtonEnabled(true); 

也可參考這個問題:Appcompat Toolbar Not Showing With Navigation Drawer

+0

謝謝:)我會盡量使用:) – Erdnuss 2015-01-16 16:33:00