Android:读取窗口标题资源id
我正在尝试创建自定义标题布局,但我仍然想使用活动的原始标签文本。有没有办法在我的自定义标题 xml 中引用窗口标题(标签属性)?谢谢。
I am trying to create a custom title layout but I'd still want to use the activity's original label text. Is there a way to reference the window title (label attribute) in my custom title xml? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试重写
Activity.onTitleChanged()
方法。我从未尝试过这个解决方案,但它必须根据 Android 源代码工作。You can try to override
Activity.onTitleChanged()
method. I've never tried this solution but it must work according to the Android source code.