Layout not displayed properly while loading Listview dynamically?

by javame_android » Thu, 22 Apr 2010 17:48:19 GMT


Sponsored Links
 Hi,

I am trying to laod the listview dynamically. There are three
textviews inside a listview. The text to be set in the textview is
fetched from the server. All this is working fine. I am able to fetch
the text and am able to display it inside the listview.

The only problem is the position of the textview. The xml layout file
is as under :

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android=" http://schemas.android.com/apk/res/ 
android"
        android:id="@+id/listViewShow"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:background="@drawable/brown_bg"
    android:padding = "3dip">

    <TextView
        android:id = "@+id/txtBabbleListTitle"
                android:layout_width = "wrap_content"
                android:layout_height = "wrap_content"
                android:textColor = "#000000"
                android:text = "Hello">
    </TextView>

    <RelativeLayout
        android:layout_width = "wrap_content"
        android:layout_height = "wrap_content">

        <TextView
                android:id = "@+id/txtBabbleDateTime"
                        android:layout_width = "wrap_content"
                        android:layout_height = "wrap_content"
                        android:layout_alignParentBottom = "true"
                        android:textColor = "#000000"
                        android:text = "Hello" >
        </TextView>
    </RelativeLayout>

    <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>

If I look at this xml layout in the eclipse layout tab then it is
displayed properly. Problem occurs only when the text is fetched
dynamically.

Can some one let me know the issue?


Thanks & Regards
Sunil

--



Layout not displayed properly while loading Listview dynamically?

by javame_android » Thu, 22 Apr 2010 21:13:04 GMT


 Hi,

It is solved now.

I was inflating the row.xml in a wrong way.


Regards
Sunil

--


Sponsored Links


Other Threads

1. Detect weather a phone is rooted or not

Hi,

I would like to find out in my application if the phone is rooted or
not.
Is there any API that tests this ?

Regards,
Tejas

-- 

2. Classpath

Has anyone set the Classpath variable in Eclipse?  If so, where is it?

-- 

3. Site for apps that help social and economic development

4. how to detect if a phone is running HTC sense UI

5. I want to distinguish why onPause() is called

6. com.android.internal.telephony.CommandException: GENERIC_FAILURE

7. Switch Soft-Keyboard