I can't find any examples of this and wonder if it's even possible? I know about the group header/group footer, but is it possible to have a single header/footer for an entire ListView that has grouping enabled?
According to the answer from the Telerk forums:
Only the Android RadListView control supports header and footer. You can check this article to see how to set them. The iOS TKListView control does not support header/footer, which means that even with custom renderer this scenario cannot be supported.
For Android, you can achieve that via Custom Renderer, there's the related code snippet in the answer. But for iOS, it seems it's not supported.
And it provide a workaround, which may help you:
The only workaround that comes to my mind for iOS (and for Android with no custom renderer) is to group the items in the list view in a single group and use the group header. Here you can find more information about grouping.
Related
I am in a situation like i have to generate UI Controls like Button,Switcher,Progress Bar, Label text etc based on my list Items .
I am looking for a way to generate the controls in a View and add Views with generated controls in a Layout .
Can anyone give me a proper way to do that?
Why not to use Fragments?
Google docs about this here
and little tutorial here
You may want to take a look at the Metawidget source code. The Android version of Metawidget makes extensive use of generating Views and Layouts at runtime (e.g. see org.metawidget.android.widget.widgetbuilder.AndroidWidgetBuilder). You may even find Metawidget itself will suit your needs (it's designed to be embedded into projects for use-cases such as this).
I have to make a custom list view with custom header, ( different text in each headers) and different number of items below each header. I have been going through various section indexing examples but I think they are not relevant much to my answer.
Anybody please suggest me a good means to move around such type of list view in android.
This might be a duplicate of Android Listview with sections
There are lots of different ones out there. One example is: http://w2davids.wordpress.com/android-sectioned-headers-in-listviews which uses: http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09
That one allows you to pass in different array adapters for each section so that you can have different layouts for each section's items.
If you were more clear about what the ones you have seen fail to do that you need it would be easier to offer you something you haven't seen.
There has been lot of thread exists on the Stackoverflow, check:
Android Listview with sections
Android ListView section header
How to draw a section header in Android listview just like the Contacts app did ?
But I am not sure these threads has helpful info, but if you want to read, understand and implement ListView with sections then here is one of the great and detailed article given by Cyril: ListView Tips & Tricks #2: Sectioning Your ListView
For a more complex design with sections in list, you should try this very standard library : https://github.com/emilsjolander/StickyListHeaders.
Other alternatives mentionned are great.
I should mention that the only drawback of this library is a poor mavenization and its absence on central.
Try this tutorial..its very nice and simple
http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/
There's a very good library for this. I've used in a project or 2 myself. Check it out:
https://code.google.com/p/android-amazing-listview/
Why can't you use expandable list view?
this link might help you: Android Exandable listview tutorial
I'm building an App for Android that already exists for iOS. On iOS, we really like to use the listview grouped style to show details and forms. It is really useful to show details of objects that we don't know how much properties they have before loading it.
I know that Android doesn't have a similar tableview style. And I don't want to use a custom library to recreate it, because I don't want to force an iOS like interface to my Android's users.
But how would you create a consistent Android interface that show similar information? Do you have example for me?
First of all, your instinct to not force iOS style UI onto Android users is correct and I respect you for it.
Android's ListView is roughly the equivalent of iOS's UITableView. There are important differences. For instance, you should never use a ListView inside another scrollable container. If a ListView is in a particular layout, it should (usually) be the only scrollable component. If you want multiple ListViews in a layout, you probably don't want ListViews at all. You should instead use (vertical) LinearLayouts and add the items in order.
Cyril Mottier writes excellent posts on implementing custom behavior for Android's ListView.
If you want to display data in a list then you can use the ListView. Here is a great article about how to use it.
I'm new to android and need to create what in .net would be called a custom control. But I have two questions:
some articles refer to them as custom controls others custom componnets and other custom widgets. What should I be looking up?
Most questions on this topic are simply refered this page http://developer.android.com/guide/topics/ui/custom-components.html which is just a view class and is a bit like being handed a chinese dictionary when asked how to write chinese and told everything you need is there. Although true, I'm looking for a simple example something like an odd shapped button with one even attached to it. Surely there must be one such example?
If you really need custom view - look this document. But easier way - customize existing components, by providing specific backgrounds and providing special events.
As a goal for my first Android application to learn the Android SDK, I am trying to create a simple RSS viewer for a specific url. Disregarding the networking side of the goal, I am having trouble with getting a listView to display a custom layout.
What I'd like to do is have each row of a list view show one of two images(read or unread), followed by some text. I'm not really having a problem, it's more that there aren't any examples that I could find (I might be looking in the wrong place) that covered custom layouts depending on conditions in code.
Any help?
Here is a free excerpt from one of my books that discusses the techniques involved. In a nutshell, you will need to extend your Adapter class (e.g., ArrayAdapter, CursorAdapter) and take direct control over the creation of rows, so you can apply your desired business logic.