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

On Nov 14, 1:07 pm, Mark Wyszomierski <mar...@gmail.com> wrote:
> One 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>
>       //listviewis 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 theListView. 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 aListViewwith 
> setItemsCanFocus=true?
>
> Thanks
>
> On Nov 13, 6:52 pm, Mark Wyszomierski <mar...@gmail.com> wrote:
>
>
>
> > Romain, thanks, that saved me.
>
> > On Nov 13, 6:34 pm, Romain Guy <romain...@google.com> wrote:
>
> > > When you add the footer to thelistviewyou need to indicate it can
> > > receive 
> > > focus:http://d.android.com/reference/android/widget/ListView.html#setItemsC...)
>
> > > On Fri, Nov 13, 2009 at 3:27 PM, Mark Wyszomierski <mar...@gmail.com> 
> > > wrote:
> > > > 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
>
> > > > On Nov 13, 6:13 pm, Romain Guy <romain...@google.com> wrote:
> > > >> Don't use a ScrollView, it won't work. Add footers to yourListView.
>
> > > >> On Fri, Nov 13, 2009 at 3:11 PM, Mark Wyszomierski <mar...@gmail.com> 
> > > >> wrote:
> > > >> > Hi,
>
> > > >> > Is there a way to create a layout with aListViewset to use full
> > > >> > height, then some additional panels? Something like this:
>
> > > >> >  <LinearLayout height = "fill_parent">
> > > >> >      <ScrollView>
> > > >> >          <ListViewheight = "wrap_content" />
> > > >> >          <TextView />
> > > >> >          <TextView />
> > > >> >      </ScrollView>
> > > >> >  </LinearLayout>
>
> > > >> > Basically I'd like to keep theListViewat a height which contains all
> > > >> > its children views, then some static widgets below that - all inside 
> > > >> > a
> > > >> > master ScrollView - is that possible?
>
> > > >> > Thanks
>
> > > >> > --
> > > >> > You received this message because you are subscribed to the Google
> > > >> > Groups "Android Developers" group.
> > > >> > To post to this group, send email to 
> > > >> > android-developers@googlegroups.com
> > > >> > To unsubscribe from this group, send email to
> > > >> > android-developers+unsubscr...@googlegroups.com
> > > >> > For more options, visit this group at
> > > >> >http://groups.google.com/group/android-developers?hl=en
>
> > > >> --
> > > >> 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
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "Android Developers" group.
> > > > To post to this group, send email to android-developers@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > android-developers+unsubscr...@googlegroups.com
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-developers?hl=en
>
> > > --
> > > 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

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to