<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ToDoListItemView自定义
="http://schemas.android.com/apk/res/com.demo.android.MyToDoList包名"
这句有没有加呢?
xmlns:ToDoListItemView自定义
="http://schemas.android.com/apk/res/com.demo.android.MyToDoList包名"
这句有没有加呢?
解决方案 »
- 求教:android webview设置的锚点在第一次加载html时不起作用,??急!!
- 关于gallery的问题
- android优化大师界面问题(有图),来讨论一下杂个实现的?
- 有没有人研究过广播接收者的异步问题
- 急,抓狂中……eclipse 中android adt安装问题
- Android 1.6下not enough memory for layer bitmap错误是怎么回事?
- 想学安卓编程,求最新教程资源
- No longer want com.xxx.xxx(pid 1970): hidden #16
- Android怎么删除360广告的jar包
- 求问,Android编程Java 如何动态创建第一个Activity
- android中如何用指定的apn连接网络
- 联网的一些应用在有了更新后是通过怎么样的通讯方式通知客户端的?
<?xml version="1.0" encoding="utf-8"?>
<com.demo.android.MyToDoList.ToDoListItemView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ToDoListItemView="http://schemas.android.com/apk/res/com.demo.android.MyToDoList"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:scrollbars="vertical"
android:textColor="@color/notepad_text"
android:fadingEdge="vertical"
/>
改为这样了 还是有问题 我感觉像是资源哪里出错了.
因为我把ToDoListItemView里的init()的调用掉,并且不重写onDraw(),就可以跑了.
<?xml version="1.0" encoding="utf-8"?>
<com.demo.android.MyToDoList.ToDoListItemView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ToDoListItemView="http://schemas.android.com/apk/res/com.demo.android.MyToDoList"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:scrollbars="vertical"
ToDoListItemView:textColor="@color/notepad_text"
android:fadingEdge="vertical"
/>哪句是你自定义的属性?
前面应该加你自定义的类:属性名.
我以前写的时候就是这样写的,不知道你是怎么弄的?
这是我以前发的帖子:
http://topic.csdn.net/u/20100929/10/7840c4bc-a69a-4ec1-90ff-14a7534c980c.html
还有这个是参考资料:
http://blog.csdn.net/Android_Tutor/archive/2010/04/20/5508615.aspx
我不是要写一个布局来呈现,是想写一个listitem的样式去替换android.R.layout.simple_list_item_1.final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1,
items
);
不用系统默认的simple_list_item_1.
margin = myResources.getColor(R.dimen.notepad_margin);
这里应该是getDimension才对.太粗心了...
<?xml version="1.0" encoding="utf-8"?>
<com.demo.android.MyToDoList.ToDoListItemView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:scrollbars="vertical"
android:textColor="@color/notepad_text"
android:fadingEdge="vertical"
/>
这个xml是ok的.
谢谢你的回复.