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. NEWBIE BUTUH INFORMASI

suhu2 dan agan2 skalian gw mau nanya nih.. tempat jual aksesoris nexus
one di jakarta dimana c? gw dah nyari2 gak ktemu2.. susah bgt.. ada
info tempat?


Sent from my nexus one rooted

-- 
"Indonesian Android Community [id-android]" 

2. good sign for even better UI improvement on future Android

VP yg incharge utk UI di palm pindah ke google, jadi bisa ngarep gingerbread
punya UI yg canggih nih :D

link:
http://www.pcworld.com/article/197353/palm_ui_vp_defects_to_google.html


cheers,
indra

-- 
*~-*~-*~-*~-*~-*~-*~-*~-*~-
"There are three constants in life... change, choice and principles." -
Stephen Covey

-- 
"Indonesian Android Community [id-android]" 

3. Re[2]: Permisi....

4. Re[2]: WTA: how to wipe Moto CLIQ

5. How to Milestone 2.1 update1

6. Re[4]: Permisi....

7. Penyebab fesbook android error - Facebook SDK Released Native App Still Struggling