非 xml AttributeSet 源

发布于 2025-01-17 22:17:55 字数 388 浏览 2 评论 0原文

我目前正在研究Attributeset的可能的自定义解决方案。为此制作包装器后,我对java.lang.classcastexception:attributesetWrapper无法施放到android.content.res.res.xmlblock $ parser。 在Internet上进行了一些搜索之后,我意识到Android资源中的某个地方可以将attributeset的私人和最终实现铸造(Kinda Optimization)。 在运行时添加而没有XML的情况下,添加您的属性有多现实?考虑到Android Studio某种程度上将所有这一切都付诸实践。 我知道从Android的角度来看,这不是完全正确的,但是我想探索绕过的可能性(通过反思或其他方式)。

I'm currently looking into a possible custom solution for the AttributeSet. Having made a wrapper for it, I got an error with the java.lang.ClassCastException: AttributeSetWrapper cannot be cast to android.content.res.XmlBlock$Parser.
Having searched a little on the Internet, I realized that somewhere in the android sources there is a cast to the private and final implementation of AttributeSet (kinda optimization).
How realistic is it somehow to add your attributes without xml in runtime? Taking into account the fact that Android Studio somehow renders all this.
I understand that this is not quite right from the point of view of Android, but I want to explore the possibilities of bypassing (somehow through reflection or other ways).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文