xml中 <com.abc.testView1
android:layout_width="wrap_content" android:layout_height="fill_parent"
android:layout_weight="1" />
<com.abc.testView12
android:layout_width="wrap_content" android:layout_height="fill_parent"
android:layout_weight="1" />
         <com.abc.testView3
           android:layout_width="wrap_content" android:layout_height="fill_parent"
android:layout_weight="1" />前两个从extends View可以正常显示第三个继承自SurfaceView就不行了?
把能正常显示的第二个View改为SurfaceView也不显示了,难道不支持SurfaceView??

解决方案 »

  1.   

    用的水平还是数值的布局?fill——parent换成普通dip看看
      

  2.   

    水平竖直不会影响吧,我想问一下,放在xml里的View怎么得到宽高啊
      

  3.   

    surfaceview用法不对么?
    surfaceview要在线程中通过SufaceViewHolder的lockCanvas方法来得到canvas对象进行绘图的。
      

  4.   

    大哥,你没有两参构造函数吧!
    http://blog.csdn.net/xiaominghimi/archive/2010/12/26/6099194.aspx
      

  5.   

    确实是我SurfaceView 没用对