У меня это работает сейчас, и мне совсем не приходилось связываться с фотошопом.Я сделал все это с помощью Android xml.
способ сделать это - использовать элемент <layer-list>
и вместо использования без заполнения, как это:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:top="6dip" android:right="6dip" android:left="6dip">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:bottomRightRadius="2dip"
android:bottomLeftRadius="2dip" android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
<solid android:color="@color/list_view_outline" />
</shape>
</item>
<item android:top="8dip" android:right="8dip" android:left="8dip">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:bottomRightRadius="2dip"
android:bottomLeftRadius="2dip" android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
<solid android:color="@android:color/white" />
<stroke android:width="1dip" android:color="#BDBDBD" />
</shape>
</item>
, затем просто используйте стандартный макет строки для строки списка:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/feed_list_row_content">
<ImageView android:id="@+id/author_image"
android:layout_width="44dip" android:layout_height="44dip"
android:layout_alignParentTop="true" android:layout_alignParentLeft="true"
android:src="@drawable/no_photo" android:layout_marginLeft="10dip"
android:layout_marginTop="10dip" />
<TextView android:layout_width="wrap_content"
android:layout_marginTop="10dip" android:layout_height="wrap_content"
android:layout_toRightOf="@id/author_image" android:id="@+id/feed_message_content"
android:layout_toLeftOf="@+id/action_button" />
<ImageView android:id="@id/action_button" android:src="@drawable/row_action"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_marginTop="20dip" />
Затем я устанавливаю фон в методе getView () адаптера пользовательского списка в качестве верхней и нижней строквизуализация отличается от средних рядов.
if(position == 0)
{
holder.contentLayout.setBackgroundResource(R.drawable.top_row);
} else if(position == posts.size() - 1)
{
holder.contentLayout.setBackgroundResource(R.drawable.bottom_row);
} else {
holder.contentLayout.setBackgroundResource(R.drawable.inner_row);
}