Layout not showing correctly when dynamically loading a list in Android?

  

    <TextView
        android:id = "@+id/txtBabbleListTitle"
    android:layout_width = "wrap_content"
    android:layout_height = "wrap_content"
    android:textColor = "#000000"       
        android:text = "New Babble has been put up." >
    </TextView>

    <TextView
        android:id = "@+id/txtBabbleDateTime"
    android:layout_width = "wrap_content"
    android:layout_height = "wrap_content"
    android:layout_alignParentBottom = "true"
    android:textColor = "#000000"    
    android:text = "2010-04-10 09:47:42" >
    </TextView>

    <TextView
        android:id = "@+id/txtBabbleTotalReplies"
        android:layout_width = "wrap_content"
    android:layout_height = "wrap_content"
    android:layout_alignParentRight = "true"
    android:textColor = "#000000"       
        android:text = "(7)" >
   </TextView> 
</RelativeLayout>

      

This is the layout I'm inflating in the adapter. Everything is displayed, but only the second text image is displayed at the top, which should be displayed at the bottom. Can anyone please let me know the problem with this?

I am considering this in layout tab in Eclipse then it displays correctly. The problem only occurs with dynamic text extraction.

+2


a source to share


1 answer


You don't specify how you "pump the adapter".



If you are doing it yourself with help LayoutInflater

, remember to use inflate(R.layout.row, parent, false)

where R.layout.row

is the layout resource corresponding to the above XML and parent

is this ListView

(which went to getView()

or newView()

where you are doing inflation). If you don't use this particular version of the method inflate()

, RelativeLayout

it won't work as a string container.

+3


a source







All Articles