<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 that I am inflating in the Adapter. Everything is displayed, but only the second textview which should be displayed at the bottom is getting displayed at the top. Can someone let me know the problem with this?
I I view this in the layout tab in Eclipse then it displays properly. The problem occurs only when the text is fetched dynamically.
You don’t indicate how you are “inflating in the Adapter”.
If you are doing that yourself via a
LayoutInflater, be sure to useinflate(R.layout.row, parent, false), whereR.layout.rowis the layout resource matching the XML you have above, andparentis theListView(which is passed intogetView()ornewView(), where you are doing the inflation). If you do not use this specific version of theinflate()method,RelativeLayoutwill not work well as a row container.