Stacking a ListView with other widgets below?

by Romain Guy » Sat, 14 Nov 2009 07:13:49 GMT


Sponsored Links
 Don't use a ScrollView, it won't work. Add footers to your ListView.



>



Stacking a ListView with other widgets below?

by Mark Wyszomierski » Sat, 14 Nov 2009 07:27:35 GMT


 Hi Romain,

If I use a footer view, it can get focus, but its internal controls
cannot be focused using the scroll ball? For example, this is a simple
footer view:

  LinearLayout llFooter = new LinearLayout(this);
  llFooter.setLayoutParams(new AbsListView.LayoutParams
(AbsListView.LayoutParams.FILL_PARENT,
AbsListView.LayoutParams.WRAP_CONTENT));

   Button btn1 = new Button(this);
   btn1.setText("Btn1");
   llFooter.addView(btn1);

When I use the scroll ball the navigate to the footer, the entire
background gets highlighted, and I cannot access the button on the
layout. Is there some way of doing that for a better user experience,
or do users just have to touch with their finger?

Thanks





> >


Sponsored Links


Stacking a ListView with other widgets below?

by Romain Guy » Sat, 14 Nov 2009 07:40:46 GMT


 When you add the footer to the listview you need to indicate it can
receive focus: 
 http://d.android.com/reference/android/widget/ListView.html #setItemsCanFocus(boolean)





>> >



Stacking a ListView with other widgets below?

by Mark Wyszomierski » Sat, 14 Nov 2009 07:53:01 GMT


 Romain, thanks, that saved me.






> >> >



Stacking a ListView with other widgets below?

by Mark Wyszomierski » Sun, 15 Nov 2009 02:08:26 GMT


 ne more question on this - it seems like if we use a header or footer
view - then our activity can not add any other views? Example:

<LinearLayout>
<ListView> // with header and footer views.
</LinearLayout>

the above works perfectly with focus getting routed correctly etc. The
focus acts strangely in this case though:

<LinearLayout>
<LinearLayout>
<Button>
</LinearLayout>
<ListView>
</LinearLayout>

if the list view has focusable items - then the focus jumps back up to
the top LinearLayout-button after hitting down key again. This is kind
of strange, should this be happening? To explain further:

<LinearLayout>
<LinearLayout>
<Button>
</LinearLayout>
<ListView>
// listview is composed of:
TextView
TextView
Button
TextView
</ListView>
</LinearLayout>

so focus is fine up until it hits the row with the Button. The button
gets highlighted (since itemsCanFocus=true), but then hitting the down
arrow key again jumps focus up to the top linear layout button,
instead of continuing focus to the next row of the ListView. Normally
I could just use a header view instead, but is there an undocumented
rule in which we cannot add other views to our layout if using a
ListView with setItemsCanFocus=true?

Thanks

On Nov 13, 6:52pm, Mark Wyszomierski <mar...@gmail.com> wrote:
> > >> >



Stacking a ListView with other widgets below?

by Mark Wyszomierski » Sun, 15 Nov 2009 04:03:04 GMT


 his is problem is probably related to this ListView bug:
http://code.google.com/p/android/issues/detail?id=4255#c2

On Nov 14, 1:07pm, Mark Wyszomierski <mar...@gmail.com> wrote:
> > > >> >



Other Threads

1. install c++ application in my android

Hi

can i install an application which have been developped in c++ in an
android device?

i have the code in c++ and i don't want to lose time to make an
equivalent application in java.


thanks

-- 

2. I can't link tweeter to my blog

I can install the Twitter icon on my blog but when I click it, not
found.  I adjusted the html code to state my Twitter domain name but
it says that it doesn't exist.  I tried to do a search but it still
says that it doesn't exist even though I see it in my profile.  Once
in my Twitter page, I look at the URL box but it only says,"http://
twitter.com."

What gives?  Thanks.
Peter

-- 

3. keeping track of time a user is actively using an android app

4. Voice Recognition - cannot suppress the visual modal dialogue

5. Fwd: [BlankOn] [OOT] Wauw GPL Kodenya bukan untuk umum, katanya sih, duh ...............

6. Relation between PhoneWindowManager and WindowManager

7. JSON deserialization - MVC Web Service