如何在 main.xml 中膨胀视图类
我如何使用 main.xml 文件来扩展我的自定义视图?我认为它具有以下格式
<com.blah.project.MainClass.innerClass />
,但我似乎无法正确获得内部类的完全限定名称。我的 customView 位于我的 Main.java 文件中,有人知道我如何正确引用它吗?谢谢。
How could i inflate my custom view using the main.xml file? I thought it carried the format of
<com.blah.project.MainClass.innerClass />
but I cant seem to get the fully qualified name of my inner class right. My customView is inside of my Main.java file, anyone know how I could properly reference it? Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试
或分离视图类。
try
<view class="com.blah.project.MainClass$innerClass" ... />
or separate the view class.
是的,但我缺少的是,为了使其膨胀,必须将视图声明为静态。
it is , but what i was missing is that in order for it to be inflated, the view must be declared static.