Layout Problem Listview in Scrollview

by guruk » Fri, 13 Mar 2009 01:42:32 GMT


Sponsored Links
 Hi,
I have a listview, there in the top is a gallery and two lines of
text, than follows my listview.
The problem ist, when i say height in listview = fill_parent or
wrap_content and i have lets say 30 items in the listview,
only the first List Item is shown (it does not fill the screen, or
show all items.) Finaly I would like the gallery in the top
, two lines textview and than the full listview. When I scroll down,
everything (incl. gallery...) has to scroll up.

Its just a trick to see if it works, that I had made listview
heigth=5300px, but for sure I would like that its auto heigh:)
And also something strange. As it is like now and the design pops up.
It does not start at the TOP (with the gallery)
instead it starts where the listview starts?!?!

Here is my layout:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:id="@+id/widget28"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android=" http://schemas.android.com/apk/res/android" ;
<LinearLayout
android:id="@+id/widget29"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
<Gallery android:id="@+id/gallery"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="bottom"
/>
<TextView
    android:id="@+id/gallery_underline1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
android:gravity="center_horizontal"
           android:textSize="16sp"
                   android:textStyle="bold"
                   android:text="Picture Info helloo"
    />
    <TextView
    android:id="@+id/gallery_underline2"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Seconde Line of Picture"
android:gravity="center_horizontal"
    />
<ListView
       android:id="@+id/shoppinglist"
    android:layout_width="fill_parent"
    android:layout_height="5366px" />
</LinearLayout>

</ScrollView>


thanks for help
chris

--~--~---------~--~----~------------~-------~--~----~



Layout Problem Listview in Scrollview

by guruk » Fri, 13 Mar 2009 01:42:42 GMT


 Hi, (sorry if this mail is twice, but i dont see my first posting
online:)

I have a Scrollview with an Gallery at the top, bellow two lines
textview and a Listview)

1. Problem.
Listview with height=Fill_parent or wrap_content does not work (it
only shows me a tiny part of the listview)
So i did just dummy Listview Height=5300, to see how it have to look
like.
What to do, that the Listview comes automaticly full filled and shown
with all items?
Finaly when I scroll the page down, the Gallery, textview and Listview
should scroll up, all.
Thats why I placed ALL in a Scrollview.

2. As it is now (with my dummy heigth 5300), when the GUI pops up, it
does not start at the top with the
gallery, instead it starts at the Listview ???!?!

Here is my Layout xml.

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:id="@+id/widget28"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android=" http://schemas.android.com/apk/res/android" ;
<LinearLayout
android:id="@+id/widget29"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
<Gallery android:id="@+id/gallery"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="bottom"
/>
<TextView
    android:id="@+id/gallery_underline1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
android:gravity="center_horizontal"
           android:textSize="16sp"
                   android:textStyle="bold"
                   android:text="Picture Info helloo"
    />
    <TextView
    android:id="@+id/gallery_underline2"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Seconde Line of Picture"
android:gravity="center_horizontal"
    />
<ListView
       android:id="@+id/shoppinglist"
    android:layout_width="fill_parent"
    android:layout_height="5366px" />
</LinearLayout>

</ScrollView>

Thanks for Help

Chris

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Layout Problem Listview in Scrollview

by guruk » Fri, 13 Mar 2009 01:47:17 GMT


 Hi, (sorry if this mail is twice, but i dont see my first posting
online:)

I have a Scrollview with an Gallery at the top, bellow two lines
textview and a Listview)

1. Problem.
Listview with height=Fill_parent or wrap_content does not work (it
only shows me a tiny part of the listview)
So i did just dummy Listview Height=5300, to see how it have to look
like.
What to do, that the Listview comes automaticly full filled and shown
with all items?
Finaly when I scroll the page down, the Gallery, textview and Listview
should scroll up, all.
Thats why I placed ALL in a Scrollview.

2. As it is now (with my dummy heigth 5300), when the GUI pops up, it
does not start at the top with the
gallery, instead it starts at the Listview ???!?!

Here is my Layout xml.

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:id="@+id/widget28"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android=" http://schemas.android.com/apk/res/android" ;
<LinearLayout
android:id="@+id/widget29"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
<Gallery android:id="@+id/gallery"
       android:layout_width="fill_parent"
       android:layout_height="wrap_content"
       android:gravity="bottom"
/>
<TextView
   android:id="@+id/gallery_underline1"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
android:gravity="center_horizontal"
          android:textSize="16sp"
                  android:textStyle="bold"
                  android:text="Picture Info helloo"
   />
   <TextView
   android:id="@+id/gallery_underline2"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text="Seconde Line of Picture"
android:gravity="center_horizontal"
   />
<ListView
      android:id="@+id/shoppinglist"
   android:layout_width="fill_parent"
   android:layout_height="5366px" />
</LinearLayout>

</ScrollView>

Thanks for Help

Chris

--~--~---------~--~----~------------~-------~--~----~



Layout Problem Listview in Scrollview

by Romain Guy » Fri, 13 Mar 2009 01:49:00 GMT


 Do NOT put a ListView inside a ScrollView. ListView already handles
scrolling, you're only going to run into trouble.






-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~



Layout Problem Listview in Scrollview

by guruk » Fri, 13 Mar 2009 01:51:39 GMT


 hanks..

just look on youtube app, they do it the same.

but i got also they limit there listview at the first page :) so i did
not the same.

thanks
chris


On Mar 12, 7:48pm, Romain Guy <romain...@google.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Layout Problem Listview in Scrollview

by Romain Guy » Fri, 13 Mar 2009 01:53:17 GMT


 ouTube does not put a ListView inside a ScrollView. They simply use a
Gallery as a header view inside a ListView.

On Thu, Mar 12, 2009 at 10:51 AM, guruk <ilovesi...@gmail.com> wrote:



--
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support. All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~



Layout Problem Listview in Scrollview

by guruk » Fri, 13 Mar 2009 02:06:19 GMT


 h thanks... that could be a solution.. yes.. great
but how to do this for example in my case?

thanks for help.. i love android but i am so newbie (usualy php
coder).. so thanks twice for your patient :)

On Mar 12, 7:53pm, Romain Guy <romain...@google.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Custom SeekBar View with x thumbs design

Hi group,

I'm trying to make a custom seekbar that can have more than one thumb
much like this one:
http://jqueryui.com/demos/slider/#range-vertical (mine should be able
to be both vertical and horizontal though).

I'm trying to get my head around how to start - I've already looked
into the existing Andriod SeekBar view and derriving from ProgressBar
view.
As I see it none of those fit the purpose 100%. So I decided to roll
my own.

I've extended the View class, and played around.
It would be nice to have features that let users set the
background,colors etc. attributes for the seekbar and thumb(s) both in
code and with xml.

I'm quite uncertain how would be the best way to design this and where
to start?
Any pointers will be greatly appreciated.

Thanks
--
lmp

-- 

2. Strangely !! The RAM usage of my APK over 20MB

Dear Senior Developers :
   I'm a junior Android developer. And i can't understand where the
problem is. As my Message Title said, i can't convince my Project
Manager the RAM usage is so high sometimes.

Here is my Steps and Situation for your reference.

Situation : My APK have 4 Activities and 1 Service. And I will check
my APK status through the function of "Setting".

Step 1 : From "Setting" --> "Application" --> "Running Service".
Step 2 : Find my APK Name, and you can see the RAM Usage and Service
running-time. Normally, my APK will cause about 3 to 5 MB RAM. But i
find the RAM Usage will become to 20MB sometimes.

So i don't know how to tune my APK or how to avoid the Memory Leak
issue. Please kindly to give me any suggestions. Many Thanks.

-- 

3. Live Report from Esquire Magazine Studio

4. Aw: Determine if device has only SoftMenu Keys ?

5. Resume for the post of Android Application Developer

6. Camera standby when screen is off?

7. [WTA] T-mobile G2x atau Mytouch.