自定义控件圆角背景

String[] mStrings = { "aaaa", "bbbb", "cccc" };
ListView listView = (ListView) findViewById(R.id.list);
		listView.setAdapter(new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_1, mStrings));





<ListView android:id="@+id/list" android:layout_width="fill_parent"
		android:layout_height="wrap_content" android:background="@layout/list_corner_1"
		android:layout_weight="1.0" />



<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
	android:shape="rectangle">
	<gradient android:startColor="#CCCCFF" android:endColor="#99CCFF"
		android:angle="90" />
	<corners android:bottomRightRadius="10dp"
		android:bottomLeftRadius="10dp" android:topLeftRadius="10dp"
		android:topRightRadius="10dp" />
</shape>


你可能感兴趣的:(android)