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. Mod: Paging Medan Android User

Khusus member id-android yang berdomisili di Medan sekitarnya

Silahkan gabung di milis id-android chapter Medan,

Klik:

2. Augmented reality problem with Android 2.2 only, Openg Surface View and Surface View for Camera. 3D Not Rendering.

Hello,

At moment I'm developing an Augmented Reality game, so I'm using the
Hardware Camera and a Surface View to show camera preview.

Everything works fine from what I've been able to test from
Android 1.5 to android 2.1
What goes wrong is in Android 2.2
If I leave the layer from 3D rendering and Camera on the same ordre
than for the previous androids then I don't have the 3D on the screen,
apparently it's drawing it on the back (behind the camera surface).

So Here is the pastebin of the code I have to change (switch the too
layer order in the current layout), also added as attached file.
http://pastebin.com/gyVd0nWR

I've searched for an answer, and have been talking on IRC #android-dev
but apparently it's not very common issue.

What is strange is that there's no release note about 2.2 that this
views have been changed or something else.

The issue is quite easy, but that means I've to have 2 versions on the
market of the same applications.

I hope someone will be able to find why this strange behavior happen
with 2.2

Thank you.

Best regards.

Yvan.

-- 

3. Salam Kenal... Kenalkan saya Jauhari

4. Kamus Istilah di Milist?

5. We need Arabic support pleeeeeeas

6. Why is emulator with WVGA loading image from drawable-mdpi?

7. Why is emulator with WVGA loading image from drawable-mdpi?