android - Problems with alignment of listview item -


I have a problem with the alignment of the various fields in each row of the list view what B under anyone know that B Go, c under c, etc ..

thanks !!

Since I can not post screenshots, I try to create an image

AAAAAAA BBBBBB CCCCCC Dddddd (This is my title)
aaa bbb ccc ddd (This is my ListView Item Is)

How can I align it?

I recommend that you use tables for such things. You can define a layout that will be set to the Each line in your ListView. In this line there will be 4 parts with the same width and the list should be in the same line and equal to one another.

  & lt ;? Xml version = "1.0" encoding = "utf-8" & gt; & Lt; TableLayout xmlns: android = "http://schemas.android.com/apk/res/android" Android: layout_width = "fill_parent" Android: layout_height = "fill_parent" Android: stretchColumns = "*" Android: weightSum = "4" & Gt; & Lt; TableRow android: layout_width = "wrap_content" Android: layout_height = "wrap_content" android: layout_weight = "1" & gt; & Lt; TextView android: id = "@ + id / AAAAAAA" Android: layout_width = "0dp" Android: Layout_height = "Wrap_content" Android: layout_weight = "1" android: gravity = "center" / & gt; & Lt; TextView android: id = "@ + id / bbbbbbbb" Android: layout_width = "0dp" Android: Layout_height = "Wrap_content" Android: layout_weight = "1" android: gravity = "center" / & gt; & Lt; TextView android: id = "@ + id / CCCCCCCC" Android: layout_width = "0dp" Android: Layout_height = "Wrap_content" Android: layout_weight = "1" android: gravity = "center" / & gt; & Lt; TextView android: id = "@ + id / dddddddd" Android: layout_width = "0dp" Android: Layout_height = "Wrap_content" Android: layout_weight = "1" android: gravity = "center" / & gt; & Lt; / TableRow & gt; & Lt; / TableLayout & gt;  

You can set your style there and whatever you want ...

I hope this will help !!


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -