现在我自己继承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自定义布局内部类
在网上查到的说是使用$进行限定,但是这样相应布局的标签头部该怎么写?
<ScrollView
class="xx.xx.xx.CustomLinear$CustomScroll"><GridView
class="xx.xx.xx.CustomLinear$CustomGrid">这样写么?还是怎么写?
谢谢大家了?Android自定义布局内部类
不过 你既然2个内部类依赖CustomLinear,那你使用时怎么破? 难道只是显示 不交互么
使用时在外部类CustomLinear里有涉及到内部类,今天查了一天也没有找到好的解决方案。
使用时在外部类CustomLinear里有涉及到内部类,今天查了一天也没有找到好的解决方案。换种思路吧 分离开单独做成view 或者写成static 不写成static估计引用不到
[html] view plaincopy
<ProgressBar
android:id="@+id/firstProgressBar"
style="?android:progressBarStyleHorizontal"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:visibility="gone" /> 上面代码中用到了“?”,那么“?”是什么意思呢?
“?”引用主题属性,当您使用这个标记,你所提供的资源名必须能够在主题属性中找到,因为资源工具认为这个资源属性是被期望得到的,您不需要明确的指出它的类型(也就是不需要写全在哪个文件中?android:attr/android:textDisabledColor)
使用时在外部类CustomLinear里有涉及到内部类,今天查了一天也没有找到好的解决方案。换种思路吧 分离开单独做成view 或者写成static 不写成static估计引用不到已经分开了,多谢了