Static text and ListView display issue

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Static text and ListView display issue

Postby williamzanelli » Sun Dec 20, 2009 11:49 pm

Hi guys,

I have an issue with a listView,

I have some static text that I want to be visible at all times, which sandwhiches a listview - the static text at the before the listview seems ok, after the listview the text doesnt appear

My layout is

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:admobsdk="http://schemas.android.com/apk/res/com.android.Example"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    >
   
<TextView 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="......"
    android:id="@+id/title"
     android:textSize = "20sp"
    />

<ListView
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:id="@+id/items"
   
   /> 
   
   <com.admob.android.ads.AdView
    android:id="@+id/ad"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"   
    admobsdk:backgroundColor="#000000"
    admobsdk:textColor="#FFFFFF"
    admobsdk:testing="true"
     admobsdk:keywords="Android application"
   
    />
   

</LinearLayout>


The ad doesnt appear below the list view but does appear above the list view

This is the listView item (row) - code..

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>


<TextView android:id="@+id/text1"
    xmlns:android="http://schemas.android.com/apk/res/android"
   
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize = "18sp"
    android:singleLine = "true"
    android:maxLength = "34"
    android:height = "35sp"
    android:paddingTop = "5sp"
     android:paddingBottom = "5sp"
    />
 
   


Any pointers?

Had a look at this - http://www.anddev.org/listview_with_oth ... t9601.html - cant see what I;m doing wrong.

Thanks in advance

Will
Will
williamzanelli
Experienced Developer
Experienced Developer
 
Posts: 63
Joined: Mon Jan 05, 2009 2:37 am
Location: UK

Top

Postby qlimax » Mon Dec 21, 2009 1:48 am

you dont see the ad because of the "fill parent" height of the listview....
you are filling the screen with the list now.


I suggest you to give a dimension in dip to the listview height.

or better, use a relativelayout as described here http://www.anddev.org/listview_with_oth ... t9601.html


there is a 3rth solution, but's a little tricky...

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <LinearLayout
  2.  
  3. android:id="@+id/LinearLayout01"
  4.  
  5. android:layout_width="fill_parent"
  6.  
  7. android:layout_height="fill_parent"
  8.  
  9. android:orientation="vertical"
  10.  
  11. xmlns:android="http://schemas.android.com/apk/res/android">
  12.  
  13.  
  14.  
  15.   <ListView android:id="@+id/android:list"
  16.  
  17.        android:layout_width="fill_parent"
  18.  
  19.        android:layout_height="fill_parent"
  20.  
  21.        android:layout_marginBottom="30dip"
  22.  
  23.        
  24.  
  25.        />
  26.  
  27.  
  28.  
  29. <TextView android:id="@+id/label"
  30.  
  31.  
  32.  
  33. android:layout_marginTop="-30dip"
  34.  
  35.              android:layout_width="fill_parent"
  36.  
  37.              android:layout_height="wrap_content"
  38.  
  39.              android:text="LABEL"              
  40.  
  41.              />
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.    
  50.  
  51.  
  52.  
  53. </LinearLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4



hope it helps
¯`·.¸¸.><((((º>¯`·.¸¸. ><((((º>
User avatar
qlimax
Master Developer
Master Developer
 
Posts: 271
Joined: Mon Aug 31, 2009 10:54 am
Location: Swiss

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 10 guests