Add custom view to NavigationBar using MasterDetailPage on Xamarin.iOS? - xamarin

I work on a xamarin project. And I would like to add a custom view as MyPersonalizedView which is in PCL project (Not a ToolBarItem !) to my NavigationBar. I use a MasterDetailPage.
By using renderer, I managed to make what I wanted only on Android but not on iOS...
Thank you in advance !

Related

How do you mix Xamarin.Forms with Xamarin.Native using MvvmCross?

According to MvvmCross 5.3 documentation you can mix Xamarin.Forms and Xamarin.Native:
"With MvvmCross 5.3, you will now be able to mix and match Native Xamarin views with Xamarin.Forms pages using ViewModel navigation!"
My scenario is the solution contains Xamarin.Android and Xamarin.iOS projects which rely quite heavily on MvvmCross. Going forward I would like to be able to create new views/pages using Xamarin.Forms. I'm assuming this is what is meant by "mix and match".
Other than the above statement I can't find any documentation or examples on how to do this.
I tried extending the MvvmCross TipCal app to show a new Xamarin.Forms view/page without any luck.
Can someone explain or provide an example of how to mix and match Xamarin.Forms with Native Xamarin using MvvmCross?
I think if you truly want to mix forms/native you need to either create a custom view presenter or trick the existing view presenter to "embed" a forms page into a viewcontroller/fragment/activity.
I have created a helper library as a proof of concept to embed Xamarin.Forms content pages into fragments/activities/viewControllers but could use some help ironing out some bugs with Android. It seems to work fine for iOS.
Let's take iOS as an example.
This approach has you create you content page as normal, but also create a wrapper viewController. You embed the content page in the viewController and when you navigate, you navigate to the viewController wrapper instead of the content page.
https://github.com/dornerworks/Mvx.Forms.PageWrapper.iOS
https://github.com/dornerworks/Mvx.Forms.PageWrapper.Android

How to add SwapChainPanel to xamarin forms

Is it possible to add "SwapChainPanel" view to Xamarin forms?
i have tried to use custom renderer but no success with that.
what i did:

Xamarin forms circular slider

I want to create like this in xamarin forms. How to implement this?
Xamarin forms create circular scroll view in both android and ios. I have checked with knobcontrol but i have problem with that.
I suggest to go for syncfusion nuget package if you want something that will be kept updated.
https://help.syncfusion.com/xamarin/circular-gauge/header

Create custom Tabbar in Xamarin Forms using NaviagtionPages & Buttons added inside a ContentPage

I want to create custom Tabbar in Xamarin Forms using NaviagtionPages & Buttons added inside a ContentPage.
I cannot use the default Tabbed Page because the UI shows up differently for Android and iOS with it (tabbar at top on android vs tabbar at bottom for iOS).
Hence, I was creating a common component using Xamarin forms.
I have created a similar custom tabbar in iOS (by adding Navigation controllers as child controllers along with buttons in a View controller).
So far I have added Buttons and ContentPages(by ContentPage.Content) inside a ContentPage. I toggle the visibility of the content pages on tapped events of the buttons.
But I want to replace the ContentPages by NavigationPages so that each tab(button) can have its own stack of ContentPages.
Unfortunately, I cannot figure out how to add NavigationPage inside a content view to make this work.

Adding Xamarin.Forms to an existing Xamarin app

I'm trying to add a Xamarin.Forms page to an existing Xamarin Android app.
I'm struggling to figure out how to mix native Xamarin Android pages and Xamarin.Forms pages.
All the articles and examples I have seen describe either Forms or Xamarin apps and not a hybrid of the two.
The best idea I have read about so far is to add a native stub and replace the content with Xamarin.Forms content but I'm not sure how to achieve this.
Update
I'm using MvvmCross so my android view is inherited from MvxActivity. I have a StackLayout containing views using Xamarin.Forms. How do I get XF to convert to android code so I can use with SetContentView?
When you create a new Xamarin.Forms project, for instance with a SharedProject approach, it will create the launcher project and initial class file that will be executed for you for each platform.
For instance on Android this is in MainActivity.cs. If you look inside this file you will notice that it inherits from AndroidActivity which in turn inherits from Activity, which is the typical class used on activities.
So you have two options available for you to create a mixed hybrid solution:-
1) Inherit from AndroidActivity in your platform-specifc stub-page should you want to display Xamarin.Forms content, or alternatively
2) Inherit from Activity, and do the same as usual.
If you want to display a Xamarin.Forms page from the stub-page you can then just use some boiler-plate code such as the following in the OnCreate method:-
SetPage({some class that returns a Xamarin.Forms.Page object, i.e. ContentPage});
You can then use the normal navigation that is specific to Android to either display a Xamarin.Forms page or a platform-specific Activity page.

Resources