Xamarin Forms: Single button that opens a dropdown menu - xamarin

Hi does anybody knows if I can make a button in Xamarin Forms that opens a small dropdown menu? I did this in android studio but I can't find a way how this could work in Xamarin.
It should look like this:
And like this if the button is clicked:
And the Button should not be in the navigation bar because this page don't have one.
So if anybody could help me I would be very grateful and sorry for my bad english.

The closest API in Xamarin that does that is to display a pop-up using DisplayActionSheet, but the dropdown menu will be at the bottom of the screen. Or you can use a Picker (link to documentation).
If you want to implement something that look exactly like the image in your post, you can create a StackLayout that contains a few buttons, and show it when the drop down menu button is clicked.

i think that you can do it not directly but if we let some things be together we can achieve it, you have to add toolbar item for the button and for the menu list it's a popup page that has transparent background and list menu on the top right !

Related

Prism Xamarin Forms ToolbarItem appearing twice

I am using Prism for Xamarin Forms application development.
May be because I am new to both Prism and Xamarin Froms because of which I am facing a basic issue with the navigation.
Let me start with the details of my implementation and then the issue at hand.
I have a MasterDetail Page (named Home) which is my main page.
There are a few menu items in the Master Page. One of them is Partner.
On Click of Partner menu item, NavigationService.NavigateAsync("Navigation/Partner") method is called. Where "NavigationService" is of type "INavigationService".
This opens a page called "Partner" which is a tabbed page (TabbedPage). The first tab is a contentpage called "PartnerAll".
PartnerAll page contains a listview. On click of a list view item, a new page is opened "PartnerDetails" by calling NavigationService.NavigateAsync("Navigation/PartnerDetails", parameters, false, true);
On PartnerDetails page, I have added a toolbaritem called "Cancel".
Issue: When "PartnerDetails" page opens up, "Cancel" item shows up twice, as shown in the screenshot:
screenshot of partner details page with two cancel buttons
Where is it I am going wrong. What should I do to make it work?
Please assist.
Best regards, Ankur Jain
You’re pushing two NavigationPage’s onto the Navigation Stack. This would result in two Navigation bars. You can see in your screenshot you have both a back and a hamburger menu icon.
You should just pass in the identifier string for your destination page, instead of pushing another instance of the NavigationPage onto the stack
do it like so NavigationService.NavigateAsync(PartnerDetails);

Xamarin.Forms how to change the navigation back button to an image?

I am building an app in Visual studio with crossed platform in Xamarin.Forms.
I have been trying to change the back arrow button in the navigation UI to an image in stead of the arrow, but I haven't found any good examples.
Is there anyone here who can help me?
Back arrow button in navigation bar is default feature. I think it can't be changed. If you want to change it then you should use a custom navigation bar.

Clickable toolbar in Xamarin

I am newest in Xamarin and have question for developers with more experiences.
I want to hide custom picker when user clicks anywhere any view in app. This working with view where is custom picker opened, but when I click on toolbar he remains opened. This problem is existing only on iOS, Android work as expected.
Could i make whole toolbar to be clickable and how?
Thanks in advance
In the Picker Toolbar you can set UIBarButtonItem to add Done button. Then you can add a Click Event for the Done button and write following code in it.
YourPicker.RemoveFromSuperview();
YourPickerView.RemoveFromSuperview();
textField.ResignFirstResponder();

Xamarin: Create layout main content, left drawer and right drawer using Xamarin native and then go Xamarin forms

The issue I need to create left and right side menu without using a plugin in Xamarin forms but right side menu is not supported.
can I create layout contains main content, left and right drawer using xamarin native and use this layout as the master layout in Xamarin forms?
If you want to have both menus, you can use the following:
Use a layaout for the main content and add two buttons (one for display right menu, the other for the left).
Add a layout after the main for the left menu and set visibility to hide
Add the code that when the user tap the button, changes the visibility of the layout created in 2.
Repeat for the right menu.
This is a easy way to achieve it. I hope this can help you.
you can use slideoverkit, if you want to with the plugin. This will help you otherwise it will take a lot of time for some perfect solution.

How to implement Sliding Panel in UWP?

I have created AppShell Page as a master page for my mvvmcross UWP(windows 10) app and added hamburger menu in it. Now I want to add two buttons like Users and Customers in hamburger menu. When click on users button i want to open sliding panel from right side with animation and display list in it and when user click anywhere in page except sliding layout then hide sliding layout.
Please suggest me any good way to achieve this.
Thank you.
Easy - use a TranslateTransform to animate sliding and Visibility to make it show up or hide.

Resources