开发者

how to inflate a view class in main.xml

开发者 https://www.devze.com 2023-01-10 12:04 出处:网络
How could i inflate my custom view using the main.xml file? I thought it carried the format of <com开发者_如何学Python.blah.project.MainClass.innerClass />

How could i inflate my custom view using the main.xml file? I thought it carried the format of

<com开发者_如何学Python.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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消