就是把一个画布和linelayout一块显示在屏幕上

解决方案 »

  1.   

    在xml文件里直接写好<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical" android:background="@color/screen_background_black"><com.view.MyView android:id="@+view/MyView" android:layout_width="fill_parent" android:layout_height="fill_parent" /><ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/ImageButton" /></LinearLayout>
    注意,在你的myView类中必须要继承 MyView(Context context, AttributeSet attrs) 这个构造函数
      

  2.   

    我可以实现,但是我其他控件不能放置在我自己写的这个view之上?
      

  3.   

    你就把你自己的View当作是一个控件好了么,然后就在xml文件里进行布局,嵌套啊
      

  4.   

    弄好了,呵呵 ,用绝对布局可以了.用linearlayout不行 .奇怪.谢谢大家的帮助.