开发者

listview and round corner doesn't work

What I want: I'am using a Listview and I want to use this view with round corners.

Situation: A listview without round corners :-( .

I use different examples to define a customShape

<?xml version="1.0" encoding="utf-8"?>
<shape
    xmlns:android="http://schemas.android.com/apk/res/android">
    <corners
        and开发者_JS百科roid:radius="30dp"/>
    <stroke
        android:width="1dp"
        android:color="#000000" />
</shape>

If I apply this customShape to the listview items(Textview) every entry in Listview have round corners. It is crazy!!! So the customShape.xml works but not with the border of the listview.

Any idea???

regard marcel


Get view by id for the list view. ListView.setBackgroundResource(R.drawable.custom_shape);

Remove the background settings in the xml . Put the custom_shape.xml in drawable folder. Remove the stroke component from it as it is not needed to round the corners

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜