回答
這在稱爲split action bar機器人
拆分操作欄提供在屏幕 底部的單獨條時顯示活性的窄 屏幕上運行的所有行動項目(如面向肖像的手機)。
實物模型顯示用突片(左)的操作杆,然後用分裂 動作條(中間);並禁用了應用圖標和標題(右圖)。
更新:
在新的UI模式被稱爲bottom toolbar
請參閱this question來創建一個。
注:Android不具有在其行動UI元素圖標的文字,截圖中的問題似乎是一個混合應用程序,並在回答的建議是最近由本機應用程序的默認UI模式的支持。
截圖中顯示的內容不是拆分操作欄。例如,分割操作欄在圖標下方沒有標題。 – CommonsWare
@CommonsWare是的,錯過了文字。然而,所有這些都是行爲而不是標籤。 –
工具欄不支持拆分操作欄。 – Sadiq
是的,你可以使用線性佈局。無論你想要什麼,只要你讓它看起來不錯。
訣竅是讓它堅持到屏幕的底部。我喜歡在相對佈局中包含所有內容,並在相對佈局內設置線性佈局,並使其與父級的底部對齊。
例如佈局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/button1"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/button2"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/button3"/>
</LinearLayout>
</RelativeLayout>
機器人:layout_alignParentBottom =「true」是這裏的重要組成部分,但也有其他辦法,使底部的線性佈局的住宿。
你可以做這樣的事情加在底部欄按鈕:
<LinearLayout android:id="@+id/footer" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"
android:layout_alignParentBottom="true" style="@android:style/ButtonBar">
<Button android:id="@+id/saveButton" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1"
android:text="@string/menu_done" />
<Button android:id="@+id/cancelButton" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1"
android:text="@string/menu_cancel" />
</LinearLayout>
- 1. 在屏幕底部添加圖像/圖標
- 2. Android:添加視圖以編程方式在屏幕底部添加視圖
- 3. 在屏幕底部有標籤的Android?
- 4. CirclePageIndicator屏幕底部
- 5. 從屏幕底部到屏幕頂部裁剪位圖150dp
- 6. 如何在表格視圖中將靜態視圖添加到屏幕底部?
- 7. 如何將標籤添加到小部件屏幕圖標?
- 8. 黑莓 - 屏幕底部的加載欄
- 9. 部分在屏幕底部(安卓)
- 10. 在屏幕頂部和底部的LinearLayout
- 11. 屏幕底部或底部的背景圖像
- 12. 將按鈕添加到不滾動屏幕的底部
- 13. Android RelativeLayout添加layout_alignParentBottom將佈局推送到屏幕底部
- 14. Bootstrap。如何僅爲移動屏幕添加底部邊距?
- 15. 關於屏幕底部的i圖標的應用程序
- 16. 如何將列表視圖標題移動到屏幕底部?
- 17. viewForFooterInSection未顯示在屏幕底部
- 18. 固定在屏幕底部的按鈕
- 19. Android KitKat:Snackbar不在屏幕的底部
- 20. 在Android屏幕底部固定內容
- 21. 將appbarLayout放在屏幕底部
- 22. 固定div在手機屏幕底部
- 23. 把Tabbar放在屏幕的底部
- 24. Admob橫幅不在屏幕的底部
- 25. 在Android中顯示TextView屏幕底部
- 26. 無論屏幕高度/寬度如何讓圖像留在屏幕底部?
- 27. 在全屏幕圖形上添加JComponent
- 28. 在登錄屏幕上添加圖像
- 29. 如何檢測屏幕的頂部和底部座標?
- 30. 如何在android中設置屏幕底部的標籤?
它最有可能是水平的LinearLayout – thumbmunkeys
使用Tab主機此 – Sadiq
我把它叫做'footer'。它可以是任何佈局(不一定是線性)或任何視圖(甚至是自定義的)。 –