Customize dropdown (Picker) list in xamarin.forms - android

I am working on xamarin.forms. I am creating an app for android. In app I have a dropdown list. I am using Picker for it. I customized it to look like dropdown. Now I need to make the first Index item to nonselactable. Means user can not select the first item. If user click on it nothing should happen. But currently when user click on the first index dropdown gets collapsed.
One more thing that I have to add in dropdown is a Cross button at index 1. Means at index 1, on left side there will be Cross button and at center there will be text like Select item. And this whole row should not be selctable. If user click at cross button dropdown should collapsed.
Anyone have idea how I can do this?

You can use listview for dropdown and control its visibility as per need.I faced similar situation where I customized list view to enact dropdown.There is another thing I want to know about Picker.Does your picker accepts or adds string only or you could customize it to accept views or controls?

Related

Disable spinner from moving to last selected item on dropdown

I have a spinner where I am adding hint at the bottom(not adding to top as getSelectedItemPosition will consider the hint as well) using arrayadapter hiding it from showing on dropdown options. The problem I am facing is, if I make the hint to show for the first time by using setSelection, then drop will directly go to bottom of the list(though hint won't show). Is there way that the dropdown will always show the top item on dropdown list irrespective of what item I select previously?

Android List item click horizontal menu

The attached UI is the calllog. What i am interested is that how the horizontal menu is implemented. When click on one list item, it appeared in one line under the list item.
In the earlier android, one click on list item, we can use Context menu popup menu to show the available action to do.
I am curious that it is using expandable list view concept?
I want to design like that when click on list item to show like this, but my layout would not be the same as this one. I want to put custom layout depending on the list item type. It may include button, textview, other widgets and the layout height will not be the list item height.
Can someone give some suggestion? Thanks a lot.

How to create a row for items in a widget, with a next button?

I am retrieving some items from html. Titles and dates...
What i want to do is put these in a widget.
But i want the widget to display a row for each item such as the title and date in a row and each item.
There is more than 1 item so it may all not fit into a widget. I know Listview's are not allowed on OS older then 3.0 So i was told i should display a button saying next..
SO how would i go about implementing this from my discription above. Im familiar with how to create a widget just not to meet the criteria i need.
So how would i go about implementing this?
Such as how would i configure the button to change views to show the next items?

Multiple Selection Spinner

I have a spinner that acts like a filter for searching among several categories. But the problem is that the spinner allows only one category to select from. Is there a way to obtain a multiple selection behavior for the spinner, or what other alternatives exists?
S spinner is designed to show one item at a time. You might get away by making a spinner of checkboxes, but it will be probably an awful user experience.
I would suggest you a ListView instead and CHOICE_MODE_MULTIPLE. You can add a listview to a dialog as shown in this answer: is it possible to create listview inside dialog?
Android provides Spinner widget which has functionality similar to drop-down list. But Spinner accepts single selection. so we select only one item at a time.so We can achieve multi-select feature using a custom Pop-up Window with a multi-select list.
Pop-up window is similar to Dialogs except that a pop-up window can be positioned.
When the drop-down button is clicked a list will be displayed(as drop-down), then you can select multiple values. The selected values will be displayed in a Text box above the list.
for reference you can prefer this link:
http://asnehal.wordpress.com/2012/04/03/multi-select-drop-down-list-in-android/

How to display "More" list item in ListView?

I want to display a list item that says "More" at the end of my ListView. Clicking on this list-item will perform some action. How can I create this "more" list item?
I don't know about the "Clicking on this list-item will perform some action" part. The typical pattern is that once the user scrolls to the bottom, new material is loaded automatically. Some people do that by detecting the scroll. I do it by putting in a "More" placeholder and detecting when that is used. Here is a component that implements this pattern.
Just add another value to your arrayadapter (or any other adapter), you might be using.set the text to 'more' .
Suppose you have n items in the list then handle the (n+1)th postion click and do your stuff.
You can add a footer to your listview...
Did you check this post out?
Android ListView Footer View not being placed on the bottom of the screen

Categories

Resources