I want to design a flyout menu which should have same look and feel in all platforms i.e. android, ios and windows. It should come out from top right corner. For that I have used Xamarin forms masterDetail page but it is rendering differently in all platforms and I am unable to do the customization. Can anyone guide me which approach should I follow, Xamarin forms with customisation or xamarin native with user control for all platforms. If customisation is possible the how?
Currently I am doing this in xamarin forms to get flyout menu and it is working in all platforms.
public class DashBoardView : MasterDetailPage
{
public DashBoardView()
{
Master = new ProfilePage();
Detail= new NavigationPage(new DetailPage())
{
BarBackgroundColor = Color.FromHex("#56c7f6"),
BarTextColor = Color.White
};
}
}
You will probably need to write a Custom Renderer for each platform, I don't think you will be able to get the behavior you want by customizing the stock MasterDetail page.
if you want rtl MasterPage in xamarin forms there're two ways to do that:
first ==>
you will make class in shared project that inherit from MasterDetailPage
you will go to each platform project and write class which renderer the class you made it in shared project and write some code for each platform that makes
watch these: https://www.codeproject.com/Articles/1100122/Xamarin-Master-Detail-Page
https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/custom-renderer/
Second ==>
- you Can do it by one class in Shared project but not by using MasterDetailPage
you will do it by Animation
You could try using the Slide Over Kit plugin.
Its free. Details here:
https://michaelridland.com/xamarin/announcing-slideoverkit-for-xamarin-forms/
Looks like this:
Related
I'm MVC .Net Developer and just a beginner in Xamarin.ios. I want to implement side bar menu slider in my app but I'm not understanding how to design it in storyboard. I've gone through some links as follows.
https://components.xamarin.com/view/sidebarnavigation
https://github.com/TheEightBot/Xamarin.SideMenu
Please provide me some helpful links and suggestions for it.
Any help is appreciated. Thank You
The best way to do this is to use the split view controller. When you create the new xamarin ios project you should select that as the template. You will need to understand UITableviews to create the navigation pane, but there are plenty of resources on that.
If you want a more customizable option I would recommend looking at syncfusion which is free to use for small organizations and developers. Here is a link to there site on how to create a custom navigation pane: https://www.syncfusion.com/products/xamarin-ios/navigationdrawer
Hope this helps. If you would like more specific info, comment and let me know. Xamarin can be kind of difficult to get into but it's a great way to build apps once you get used to it.
I want to implement augmented reality with xamarin forms. I found ARKit and ARCore library for xamarin.ios and xamarin.android respectively.
Can I use these both library in my PCL class library of xamarin.forms?
Can I integrate my page (layout or activity or UIViewController) to content page of my xamarin.forms?
Does renderer help to achieve the functionality?
Can I use these both library in my PCL class library of xamarin.forms?
Most likely you can't. ARKit should be a native iOS library and ARCore is an Android library (Java)
Can I integrate my page (layout or activity or UIViewController) to content page of my xamarin.forms?
As far as I know not directly. You will need a custom renderer that will create the native view for your Xamarin.Forms view.
I'd suggest to have a look at Customizing a ContentPage.
The basic method is
Create a page type that is derived from ContentPage
Create custom renderers for each platform
Implement the OnElementChanged method
Create the native view
Add the native view with SetElement
I want multiple strings to be added and deleted in a view. I can achieve this by using native libraries.
Native iOS: CLTokenInputView-Swift-master
Native android: TokenAutoComplete-master
I want to implement this in Xamarin forms for both iOS and android. Is there any way to achieve this? Or any library files available?
I think what you are looking for is something like the TagEntryView. It may not do everything you want but it is open-source so maybe you could get the important parts out of there and customize it as you like.
Is there any way to inject platform specific views into shared pages?
Say I have a TabbedPage in my shared project, and I would like to inject a Page/View into it that uses the platform specific 2D drawing features, how would this best be solved?
In the ContentPage you can add your own custom view control, to which you can then implement Custom Renderers - one for each platform from this shared view.
Its from within the Custom Renderers classes where you can then access all the native APIs such like overriding the OnDraw(canvas canvas) and do your custom 2D drawing on Android etc.
When you mention Page/View, I am going to assume you are really meaning View, as I don't believe its possible to render a ContentPage within an existing ContentPage.
I have been looking into using MvvmCross as our solution to cross platform development, with previous development being solely targeted at iOS. I have come to really like how storyboards encompass all the views together along with the flow between them.
I know Monotouch supports their usage with the storyboard projects which I have been able to work with, however I have not been able to find any reference/example to it being using with MvvmCross.
Is this currently supported? or can someone provide me some tips as to how I can get this setup. The initiation seems to be the issue as in the storyboard projects the FinishedLaunching method in the AppDelegate is usually empty
Is this currently supported?
I don't believe it is.
I've never used Storyboards to build anything other than a demo app - so I'm not an expert.
However, from what I know I think there are 3 problems that you would need to overcome.
1. Storyboards don't have code in FinishedLaunching
This is easy to solve I think - you can just add an override to FinishedLaunching which calls an MvvmCross Setup class in order to initialise IoC, Plugins, your App, etc.
2. MvvmCross vNext requires you to override the constructors to forms like
public DetailViewController (MvxShowViewModelRequest request) {
}
while Storyboards require the use of forms like:
public DetailViewController (IntPtr handle) {
}
Overcoming this is harder... but the good news is that it should be a lot easier in v3 - one of the stated aims of v3 is to somehow support storyboards - see http://slodge.blogspot.co.uk/2013/02/mvvmcross-v3.html
3. Clash of concepts
If you are using Storyboards, then the navigation logic is tied to the Storyboard and to the UIViewController.
If you are using MvvmCross, then the navigation logic is tied to the ViewModels.
Overcoming this would be relatively straight-forward - you can easily mix and match concepts - but you might find your ViewModels and Views feeling 'a bit odd' as a result.
Summary
Doing this today is possible but would require some hours of hacking.
A beta of v3 is due very soon (within weeks - just depends on my spare time). Once that is available I think you'd be able to get started much quicker.