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微调自定义步骤