如何实现自己写的view类的画布和本身的控件ImageButton一块显示 就是把一个画布和linelayout一块显示在屏幕上 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在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) 这个构造函数 我可以实现,但是我其他控件不能放置在我自己写的这个view之上? 你就把你自己的View当作是一个控件好了么,然后就在xml文件里进行布局,嵌套啊 弄好了,呵呵 ,用绝对布局可以了.用linearlayout不行 .奇怪.谢谢大家的帮助. ant编译第三方包问题 layout_gravity的问题 tcp如何组包 如何通过JNI将复杂对象传递到本地代码? 请教:Base64编码,在API Level 8以前大家用哪个函数? Android 如何解压RAR压缩文件? 想学安卓编程,求最新教程资源 关于从assets中读取文件的一个小问题,求大神帮忙看下~~~~~ 所有的R.都报错了 包括自动生成的代码 小弟初学Android 希望各位前辈多多指教 谢谢了 谁能把Andriod SDK tools 里的zipalign.exe文件发给我一个 查询天气,返回失败 蛋疼贴: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) 这个构造函数