现在我自己继承LinearLayout定义了一个空间CustomLinear, 在CustomLinear中又定义了两个内部类CustomScroll(继承自ScrollView)和CustomGrid(继承自GridView),这两自定义的类由于都要访问CustomLinear中的数据,因此都不是static类,现在如果我要在xml中布局CustomScroll和CustomGrid的话,布局文件该怎么写呢?
在网上查到的说是使用$进行限定,但是这样相应布局的标签头部该怎么写?
<ScrollView
class="xx.xx.xx.CustomLinear$CustomScroll">
<GridView
class="xx.xx.xx.CustomLinear$CustomGrid">
这样写么?还是怎么写?
谢谢大家了?
Android 自定义布局 内部类
------解决方案--------------------
这样写感觉可以 没遇到这么具体的例子
不过 你既然2个内部类依赖CustomLinear,那你使用时怎么破? 难道只是显示 不交互么
------解决方案--------------------
换种思路吧 分离开单独做成view 或者写成static 不写成static估计引用不到