1
A
回答
1
是按照以下方法,您可以创建它。
您的列表视图的行项目文件。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/round_shape"
android:orientation="horizontal"
android:padding="10dp" >
<TextView
android:id="@+id/id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/Name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="6dip"
android:paddingLeft="6dip"
android:textSize="17dip"
android:textStyle="bold" />
</LinearLayout>
round_shape.xml
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient
android:angle="270"
android:endColor="yourstartcolor"
android:startColor="yourendcolor"/>
<corners
android:bottomLeftRadius="27dp"
android:bottomRightRadius="27dp"
android:topLeftRadius="27dp"
android:topRightRadius="27dp" />
</shape>
0
是的,你可以使用一个SimpleAdapter
把你的每个项目在ListView
想要的布局:
公共SimpleAdapter(上下文的背景下,List> data,int resource,String [] from,int [] to)
参数 上下文:与此SimpleAdapter关联的视图正在运行的上下文 数据:地图列表。列表中的每个条目对应于列表中的一行。地图包含每行的数据,并应包含“from”中指定的所有条目。 资源:定义此列表项的视图的视图布局的资源标识符。布局文件应至少包含那些在“to” 中定义的命名视图from:要添加到与每个项目关联的Map的列名列表。 到:应在“from”参数中显示列的视图。这些都应该是TextView。该列表中的前N个视图被赋予from参数中前N列的值。
然后设置该适配器的ListView
1
矩形边框适配器可以使border.xml如下...
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<stroke android:width="1dp" android:color="#000000"></stroke>
</shape>
,你可以将它设置成你的Textview背景...像下面...
<TextView
android:id="@+id/Name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="6dip"
android:paddingLeft="6dip"
android:textSize="17dip"
android:textStyle="bold"
android:background="@layout/border"/>
相关问题
- 1. 矩形边框不显示
- 2. android show在显示屏上的矩形
- 3. 的Android ProgreesBar只显示进度条没有背景矩形框
- 4. 在LineChart中显示矩形
- 5. Android显示矩形而不是空白
- 6. 在布局中显示绝对中心的矩形框
- 7. 如何在视图框内显示一半的矩形画布
- 8. 显示文本框居中在一个倾斜的矩形
- 9. QML中未显示矩形
- 10. d3矩形不显示
- 11. 石英,矩形不显示
- 12. Drawables显示黑色矩形
- 13. Java不显示矩形?
- 14. 如何在android中显示矩形缩略图的视频
- 15. 将矩形框放在更大的矩形框中
- 16. 如何在鼠标上显示矩形?
- 17. 矩形将不会在JFrame中显示
- 18. 在矩形中显示图像?
- 19. textItem不显示在矩形内
- 20. 矩形不显示在舞台上?
- 21. 如何定期在Android活动中显示矩形
- 22. 的CSS的unicode显示空白矩形
- 23. 矩形的样式可以显示边框吗?
- 24. 如果光标在光标上,则显示矩形,如果光标在光标上,则显示矩形;如果光标离开子窗口,则显示矩形
- 25. SVG矩形内的标题不显示
- 26. bootstrap-sass 3.3.3显示为矩形的glyphicons
- 27. 画的矩形没有显示
- 28. 显示矩形中的原始图像
- 29. 显示画布矩形的TextView
- 30. HTML Canvas不显示我的矩形
谢谢我会试试 – maram
最受欢迎........ !!快乐编码.. –