急求!!!如何不用shape设置listview item的圆角!!! listviewshape圆角 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 还是使用shape,你想要的时候就动态将背景设置成圆角背景,不想要的时候就动态把圆角背景去掉,换成一个你想要的背景就行了,变通 我想你可能是主要我不知道你其他代码是什么样子的,但是你这个问题很常见的,其实主要是MATCH_PARENT造成的,你想要显示圆角的布局要和它的父布局隔开一点,我上传个代码你看下 <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ListView android:id="@+id/ufnh_list" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="5dip" android:divider="@null"> </ListView></LinearLayout>我的item是带圆角的,但是当我把android:layout_margin="5dip"这句去掉,圆角显示不出来,但是当我把android:layout_margin="5dip"这句加上圆角就有了 用手机调试安卓程序,一连手机就不停的报很多错误,怎么解决 listview的item的背景随最外层layout背景改变,求解救 摄像头录像驱动的问题 做android测试暴出的错误。坐等求解 getLastKnownLocation如何清空缓存啊 android pull解析子节点问题 android混淆打包出现的问题 怎样从一个界面跳转到百度一下界面?并且将值显示到百度一下的框里? gridview 显示sdcard中图片的问题 百度地图sdk怎么给线段添加点击事件 ListView中的editText问题。 软件黑屏问题
主要我不知道你其他代码是什么样子的,但是你这个问题很常见的,其实主要是MATCH_PARENT造成的,你想要显示圆角的布局要和它的父布局隔开一点,我上传个代码你看下
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/ufnh_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dip"
android:divider="@null">
</ListView>
</LinearLayout>
我的item是带圆角的,但是当我把android:layout_margin="5dip"这句去掉,圆角显示不出来,但是当我把android:layout_margin="5dip"这句加上圆角就有了