2
<com.test.www.BrushPreview android:id="@+id/brushview"
android:layout_width="100dip" android:layout_height="100dip"
android:layout_gravity="center" />
<View class="com.test.www.BrushPreview" android:id="@+id/brushview"
android:layout_width="100dip" android:layout_height="100dip"
android:layout_gravity="center" />
继文档http://developer.android.com/guide/topics/ui/custom-components.html#modifying它应该工作两者兼得!我究竟做错了什么?
编辑: 小写视图似乎工作!我以为我已经尝试过......谢谢! ,此外,it's非常重要的视图类使用此构造:
public BrushPreview(Context context, AttributeSet attrs)
否则不需额外调用。
会发生什么情况?例外?它只是不出现? – 2011-05-10 07:06:55
你有任何关于此路径的类文件com.test.www.BrushPreview ..? – 2011-05-10 07:14:09
@CapDroid我想他相信他,因为他说第一种方法工作正常 – 2011-05-10 07:15:39