Android:读取窗口标题资源id

发布于 2024-11-29 14:40:08 字数 74 浏览 6 评论 0原文

我正在尝试创建自定义标题布局,但我仍然想使用活动的原始标签文本。有没有办法在我的自定义标题 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忱杏 2024-12-06 14:40:08

您可以尝试重写 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文