I'm trying to create a navigation bar for my Xamarin Forms app. I'm adding some primary ToolbarItems which will have an icon associated with them using the following syntax:
ToolbarItems.Add(new ToolbarItem("Search", "ic_action_search.png", ActionSearch, ToolbarItemOrder.Primary));
I've searched everywhere but I cannot find the recommended images sizes for each platform (Android, iOS, UWP, Windows, and WinPhone).
Does anyone know what they should be?
A google search for "recommended tool bar icon sizes [Android|iOS|UWP] was very useful here.
iOS:
https://developer.apple.com/ios/human-interface-guidelines/graphics/custom-icons/
Android:
https://developer.android.com/guide/practices/ui_guidelines/icon_design_action_bar.html
UWP:
https://msdn.microsoft.com/en-us/windows/uwp/controls-and-patterns/tiles-and-notifications-app-assets
No good chart that I found for UWP as it is quite a bit more complex due to support of Tablets, Phones, and Desktop, but the needed info is in the guide above.
Related
I need to design bottom navigation bar like I attached image using xamarin.forms common code for both android and IOS. Can anybody refer any link or library tool to do this?
You should check the xamarin community toolkit, this is certainly possible to create with the tabview.
https://learn.microsoft.com/en-us/xamarin/community-toolkit/views/tabview
I am newbie to Xamarin development.
In android we have different values folder for multi-device support.
But In Xamarin forms how we give multi-device support for Android & iOS?
Anyone don't know about what is multi-device support pls check the sample document by Android
https://developer.android.com/guide/practices/screens_support.html
I want similar like this for Xamarin forms.
Note: I am asking about Xamarin forms not in native code.
Any suggestions or ideas are welcome. Thanks for your answers.
How to give multi-device support in Xamarin Forms
Xamarin.Forms XAML Support :
Xamarin.Forms use the platform-specific mechanisms to calculate the absolute pixel dimensions. As Digitalsa1nt said, Xamarin.Forms uses xaml as it's base markup language for renderng displays, and converts this into the native counterparts at runtime. Usually, you don't have to care about the resolution, it will adjust the views based on your layout and constraints.
Some useful link about Xamarin.Forms multi-device support :
Bringing Xamarin.Forms Apps to Tablets
Provides a few nice helper methods to extend the app for a better tablet experience
Device Class
The Device class contains a number of properties and methods to help developers customize layout and functionality on a per-platform basis.
Layout for Tablet and Desktop apps
Discuss about the supported device types, and how to optimize layouts for tablets versus phones.
Cross-platform Image optimisation
Images can be shared across platforms with Xamarin.Forms, they can be loaded specifically for each platform, or they can be downloaded for display.
Master Detail Pages
Ideal for focusing on just large screen devices
Update :
You could read this official document: Dealing with sizes and the related sample. It demonstrates many solutions to solve your problem :
Platform-specific font size
Metrical sizes
Estimated font sizes
Fitting text to available size
Empirically fitting text
A fit-to-size clock
Accessibility issues
For example : the Platform-specific font size at no cost
In some cases we need to assign a different font size to controls based on the specific operating system's styles, avoiding hard-coded values. Through the Device class, Xamarin.Forms makes this possible at no cost.
In your Page OnAppearing() method :
protected override void OnAppearing()
{
base.OnAppearing();
this.LargeLabel.FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label));
this.SmallLabel.FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label));
this.MediumLabel.FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label));
}
Effect :
As per the requirement of the project I need to have the page which should behave as the default Apple Mail app on the iPhone.
Attaching a gif that I have created for the same.
I tried using the plug in https://github.com/rotorgames/Rg.Plugins.Popup
but I couldn't achieve the exact same behavior where the background shrinks and expands as the modal pop up is dragged.Any leads, examples or demos will be really helpful.
Note: I am using Xamarin.Forms.
With the new Xamain Forms update. i.e. after iOS13
The model behavior has became the default model behavior for Xamarin iOS.
When you do.
Navigation.PushModalAsyn(<your_page_here>).
It gives the above (gif) behavior.
Hi I am building a magazine viewer and I need to zoom and drag the content pages. I am using scrollview but I guess the zoom works only for ios. Is there any workaround for this? I am using Titanium 5 sdk, and don't found modules that support it.
On Android you might be able to use http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ImageView-property-enableZoomControls
I am working in xamarin pcl project , I am trying to keep sliding drawer in my pcl project but i dont know how to do that .
Are you using Xamarin.Forms?
If not, i would advice to use a framework like MvvmCross (https://github.com/MvvmCross/MvvmCross)
This would enable you to split the actual implementation of the drawer / hamburger menu into the different UI projects like iOS and Android(maybe WP8 too).
Since those platforms all behave differently, for example Android uses Fragments which are replaced inside the activity containing your navigation drawer, you should use a custom presenter to determine where you want the specific platform to navigate to. You can find more information on that topic here: http://slodge.blogspot.co.uk/2013/06/presenter-roundup.html