简体   繁体   English

如何在 Activity 上添加多个片段的同时划分 android 的操作栏

[英]How can I divide the Action bar of android while adding more than one fragment on Activity

平板电脑模式下的 Gmail 应用程序

Is there any way to put the search icon aligned with the left fragment(list of email) and others action bar action related to right fragment(detail of selected email)with right.有没有办法将搜索图标与左侧片段(电子邮件列表)和其他与右侧片段(所选电子邮件的详细信息)相关的操作栏操作与右侧对齐。 Is there any way (custom or standard) to utilize the status bar for putting icon related to fragment like in gmail app.有没有办法(自定义或标准)利用状态栏来放置与 gmail 应用程序中的片段相关的图标。

It's not status bar, it's ActionBar.它不是状态栏,而是 ActionBar。 Yes, you can.是的你可以。 In your Activity, before setContentView :在您的活动中,在setContentView之前:

requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
this.getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title);

So you need to make custom title layout and put there everything you want所以你需要制作自定义title布局并将你想要的一切放在那里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在活动中使用多个广播? - How can I use more than one Broadcast in activity? 如何在一个活动中将一个界面用于两个以上的后台Android任务? - How one interface can be used for more than two background android tasks within one activity? 将容器和操作栏添加到Android活动。 - Adding containers and action bar to an Android Activity. 如何为多个活动恢复屏幕活动? - How do I resume screen activity for more than one activity? 如何在 Android 中使用 AlarmManager 设置多个警报? - How can I set more than one alarm with AlarmManager in Android? 如何在 android 的 Activity 上不添加地图片段的情况下获取我的位置? - How can I get my location without adding Map fragment on Activity in android? 如何获取ToggleButton来识别Android活动中的多个单击? - How do I get a ToggleButton to recognize more than one click in an Android activity? 如何将java活动中的多个变量传递给javaclass? - How can i pass more than one varible from a java activity to a javaclass? 如何在搜索视图中使用多个按钮进行操作? - How can i have more than one buttons on action with search view? Android Mvvm,具有多个活动的应用程序 - Android Mvvm, app with more than one activity
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM