0
A
回答
0
您可以簡單地使用工具欄作爲操作欄。 工具欄是一個ViewGroup,您可以爲其添加任何自定義視圖。
例如:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:minHeight="?attr/actionBarSize"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:titleTextColor="@android:color/white"
android:background="?attr/colorPrimary">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<YourViewHere/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
,並在您的活動:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
// Find the toolbar view inside the activity layout
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
// Sets the Toolbar to act as the ActionBar for this Activity window.
// Make sure the toolbar exists in the activity and is not null
setSupportActionBar(toolbar);
}
相關問題
- 1. 動作欄微調器定製
- 2. 自定義android微調?
- 3. 自定義android微調
- 4. 自定義微調樣式
- 5. Android自定義微調器
- 6. 微調自定義baseadapter
- 7. Android微調自定義?
- 8. android自定義微調器
- 9. 如何從自定義微調Android中
- 10. 動作欄自定義視圖
- 11. 造型微調操作欄
- 12. 自定義操作欄sherlock
- 13. 中心動作欄標題
- 14. 活動組內自定義列表中的微調問題
- 15. 在android中自定義動作欄首先顯示默認動作欄
- 16. 自定義微調項目不作爲微調項目的一部分出現
- 17. 自定義微調視圖(不想彈出微調)
- 18. 自定義ArrayAdapter自定義微調器在不同的文件
- 19. 自定義微調器與動態對象和動態圖標
- 20. Android微調器自定義佈局
- 21. 如何自定義微調框?
- 22. 微調器下拉式自定義
- 23. 如何創建自定義微調器?
- 24. setContentView,微調框自定義alertdialog在android
- 25. Android - 自定義微調控件外觀
- 26. 自定義列表視圖與微調
- 27. 自定義加載指示器(微調)
- 28. 自定義字體的Android微調
- 29. 如何自定義微調器?
- 30. JqueryUi微調自定義步驟