如何为 Android 应用程序中的所有活动创建固定导航栏
我想为我的应用程序的所有活动设置一个通用的导航栏(带有两个按钮和一个文本视图)。我知道可以通过将通用布局文件包含到每个活动的布局文件中来完成。但当一个活动更改为另一个活动时,我必须使用幻灯片过渡动画。现在,如果我遵循包括流程在内的通用布局文件,那么导航栏也会随着活动视图滑入或滑出,我希望当活动视图滑入或滑出时固定导航栏。此外,应该设置导航栏的两个按钮,因为我可以通过对某些活动使用代码来隐藏它们。所以现在我在这个问题上非常需要帮助,请给我一个关于这个问题的解决方案/建议/线索。提前致谢......
i want to set a navigation bar ( with two buttons and a textview ) common for all activities of my application. I know it can be done by including a common layout file into each activity's layout file. But i have to use slide transition animation when a activity changes to another. Now if i follow the common layout file including process, then the navigation bar will also slide in or out with the activity's view where i want my navigation bar to be fixed when activities view slides in or out. Besides, the two buttons of the navigation bar should be set as i can hide them by using code to some activities. So now i need help badly on the problem, please give me a solution/suggestion/clue on the problem.Thanks in advance .....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许 Fragments 可能正是您在这种情况下寻找的。
或者进一步考虑一下,也许具有多个布局的 ViewFlipper 也可以对此有所帮助案件。
Perhaps Fragments may be what you are looking for in this scenario.
Or thinking about it further maybe ViewFlipper with multiple layouts could also help in this case.