나를 안드로이드 멍청이라고 생각해보십시오. 사용자 정의 ListView를 만들려고합니다.이 형식은 ('this'는 BlackBerry에 구현 된 사용자 정의 ListView이지만, Android에서 동일한 모양과 느낌을 만들고 싶습니다.)Android : 맞춤리스트 뷰 드로잉
' 현재했습니다 다음 안드로이드 코드와 XML을 마련하지만, 표준의 ListView의 모양이 변경되지 않습니다
코드 :
public class RoundedListView extends ListView
{
public RoundedListView(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
public RoundedListView(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
public RoundedListView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}
public void onDraw(Canvas canvas)
{
Paint paint = new Paint();
paint.setColor(Color.CYAN);
canvas.drawRect(10, 10, 10, 10, paint);
canvas.drawColor(Color.YELLOW);
super.onDraw(canvas);
}
}
는 XML (main.xml에) :
을<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.gravityzoo.android.containers.RoundedListView
android:layout_height="wrap_content"
android:id="@+id/listView1"
android:layout_width="match_parent">
</com.gravityzoo.android.containers.RoundedListView>
</LinearLayout>
누구든지이 간단한 그리기 기능을 작동시키는 방법을 알고 있습니까? 미리 감사드립니다.