Using a Xamarin Forms ListView with a custom ViewCell, is it possible to have a list item expand based on an event? Please ignore the orange lines, but reference the below picture...
Regular cell not expanded
User has tapped the triple dots causing the ViewCell to expand to show additional content
Is this possible? What is the technique to make that work?
You can have containers or elements inside your viewcell whose Visibility can be controlled based on the click. You will have to re render the elements once its expanded or collapsed for the viewcell to resize. Or else you will have the Viewcell being the size it was initially rendered, but the contents inside it overflowing.
Check out the following links :
How to implement Expandable/Collapsible ListView in xamarin forms?
CollapseListView-in-xamarin.forms
ExpandableListView
Related
When I use a Button control in DataTemplate for ListView (UWP app), Drag-and-Drop of ListView items doesn't work. If I use containers like StackPanel, RelativePanel or Grid, instead of Button control, everything works fine. I would prefer the Button control as a container, because I like its mouse Hover effect on ListView items. I can do something similar for StackPanel, etc, with a custom hover effect by using a combination of Style and Behavior programming but trying to avoid this route (too involved).
Can I do something to the Button control so that it gives me the hover and also responds to the Drag-and-Drop event when part of a ListView DataTemplate?
I am also curious what specifically makes the Button suppress the Drag-and-Drop of ListView items.
The Button is capturing the pointer which cause the pointer click event not be bubble up to the ListViewItem which cause the Drag&Drop to start.
You can take a look at ReleasePointerCapture method which will release the pointer capture allowing other item to capture it.
You will need to create a new class which extends the default Button class and override for example the OnPointerPressed method to choose the logic between the drag&drop and the click on the button.
I want to keep an always topmost canvas on a listview. Canvas should be stretch on window and if the user tries to scroll listview, listview must scroll but canvas must be topmost transparently and user can see listview. My XAML tree like below that:
<Grid>
<ScrollViewer>
<ListView>
</ListView>
</ScrollViewer>
<Canvas Name="DxPanel"></Canvas>
</Grid>
I am trying to make a note taking app. The reqirements like that:
Each listview has image or richeditbox control (I have already done it)
The user can draw something on image or rich text
The listview must have infinite scroll ability and data of list view must retrieve from database and data and UI recycling must be supported.
The drawing layer must be endless scroll
I know this is hard challenge. I am planning to save stroke , and text data in db and image data in disk.
First of all, I need to say, there is no need to put a ListView inside a ScrollViewer, by default ListView can be scrolled if there are many items, this is because there is a ScrollViewer inside the template of ListView, you can refer to the default ListView styles and templates.
Then, if your Canvas keeps covering the ListView, there is no way for your ListView to get focused, let alone make the ListView scrolling. So I suggest you to rethink about this, why should your Canvas be topmost transparently?
If you want your ListView can be scrolled/focused, and in the meanwhile your layout in the Canvas can be seen, then you can put the ListView above the Canvas, by default the background of ListView is transparent.
You can leave a comment to tell us what is in your Canvas, why this Canvas should be stretch and placed on the top of the ListView, maybe we can try to find other way to solve your problem.
I'm developing WP8.1 app in that I need to show some content with show/hide functionality. First 2 lines will be displayed and once clicking on that item the remaining content should expanded and display. How we can achieve this in WP8.1
In order to show or hide you have to go for binding.
And to expand the content, have your DataTemplate as StackPanel and set the Height property of TextBlock (through binding) with the value that is needed to display two lines.
And on tap of the item, just get the selectedItem instance and Increase the height property or set to auto
To know about binding see here http://msdn.microsoft.com/en-us/library/windows/apps/cc278072(v=vs.105).aspx
you can use visibility and collapsed
like that
myimage. visibility =visibility.visible;
you can control with this way
I am trying to show an entrybox after tapping an image.
I have this:
And I want to achieve this after tapping on the keyboard image:
The gesture is not a problem I add this lines:
keyboard.GestureRecognizer.Add(new TapGestureRecognizer((view,args) =>
{
ShowEntryBox();
})):
The problem is that I do not know how I can show the entry box, I use XAML. I tried relativelayout and I saw samples of absolutelayout but I can not achieve it.
I am using Xamarin forms to android and ios App.
Perhaps try a Grid?
In the center cell you can create two child controls:-
*) Label control.
*) Entry control.
and then give these controls each a name and set the appropriate .IsVisible value on each of these two controls accordingly, or alternatively hook the IsVisible for each of these controls into a ViewModel and set the state there instead.
I have a working Ext.List object in my Sencha Touch application. I'm rendering each item in the list using the List's itemTpl property. I'm noticing that each individual list item can be scrolled in addition to the whole list which is definitely not what I'm after.
Does anyone have any advice on how to get the individual list items not to scroll? I've tried setting the outermost div in the itemTpl template to have a specified height and overflow:hidden...but this does not prevent the scrolling behavior.
Is it the default HTML scrollbar as rendered by the browser, or is it the built-in scroll feature of Sencha Touch (the iScroller which fades in and out)? If it's the latter, try setting the scroll attribute of that ListItem object to false.
If the former, there's obviously a problem with your CSS selector. Could you share your code if it's this one?
Have you tried to set the height of the list-element, so all the content of a single list-item is visible (so you can't scroll anymore)?