I have a program with xamairn forms, One client project is UWP. The Master of
MasterDetailPage control has normal appearance within Android and IOS platform , But it looks unfriendly within UWP platform. I know I can use Grid to replace. But, I am not sure there are some issues in the Masterdetailpageor I miss some key procedure to use it.
at UWP like this:
But it looks unfriendly within UWP platform. I know I can use Grid to replace. But, I am not sure there are some issues in the Masterdetailpageor I miss some key procedure to use it.
If you have not set MasterBehavior for MasterDetailPage. The Master will split open by default as you mentioned. Please set MasterBehavior according to the following code. And you will get normal appearance.
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MasterDetailPageNavigation;assembly=MasterDetailPageNavigation"
x:Class="MasterDetailPageNavigation.MainPage" MasterBehavior="SplitOnPortrait">
</MasterDetailPage>
Related
I'm developing an app using Xamarin with .netstandard 2.1 and can't find a way to change the action bar of the android app.
The blue bar isn't the color I want, and following all the docs and tutorials over internet, I found even a way to change the status bar (where the clock and battery and notifications are), but can't change this blue to Orange.
Can someone tell me what should I'm doing wrong, please?
Thanks
Set the attached property BackgroundColor="Red" either globally at <Shell> level:
<Shell
...
BackgroundColor="Red">
Or at ContentPage level using:
<ContentPage
...
Shell.BackgroundColor="Red">
note that this will affect navigation bar (the one you described) and also upper tabs (TabBar).
Inside your shell app xaml file, at the top use Shell.BackgroundColor="Red".
<Shell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:App1.Views"
Title="App1"
x:Class="App1.AppShell"
Shell.BackgroundColor="Red"
>
I am developing an app like Ola and Uber which will have navigation system and live tracking inside my Xamarin Forms app (For Android and iOS both platforms). So, can anyone please tell me the way to open the navigation map inside the app?
If you are trying develop an app like Ola/Uber which will have navigation system and live tracking inside the app, then you don't need to open the navigation map inside the app. You just need to display it on the page.
You can follow the official Xamarin.Forms documentation here, to add maps into your Xamarin Forms app. There's a full fledged map sample that you can also see to understand what needs to be done, but your XAML will look something like this:
<ContentPage ...
xmlns:maps="clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps">
...
<maps:Map x:Name="map" />
...
</ContentPage>
The 3 dots indicate other controls you would like to add into the page and the layout that you have to put the Map control inside.
In fact you can also take a look at the sample code of several apps (RunAway, YellowClone, SmartHotel, BikeSharing, Movies, Evolve) in Javier Suarez's Good Looking UI curated collection.
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
Is there a way to define a Label in Xamarin Forms (XAML or code-behind) AppXYZ that can be updated from the Xamarin Android AppXYZ.Android: MainActivity.cs and AppXYZ.iOS:Main.cs? i.e. upon an event in Android (e.g. BlueTooth) set a short text in a common Forms elements? After viewing many example, no clarity yet. MessageCenter perhaps?
In Android Project: MainActivity.cs (for example):
FormsAppXYZ.LabelXYZ.Text = "Updated string";
If not possible, then proper way to do this with Xamarin Android Native ? appreciated since I'll have to mix in the label into a shared Xamarin Forms Tabbed GUI.
Depending on how much Bluetooth work you need to do, my first suggestion would be to use MessagingCenter as you have already alluded to.
The other obvious approach would be to use a third party plugin, as I don't believe Xamarin have released one. I am currently aware of these two:
https://github.com/aritchie/bluetoothle
https://github.com/xabre/xamarin-bluetooth-le
How can I add a badge to one of TabbedPage ToolBarItems? I create all my pages and tabs in shared code (forms) and I see no way of doing it there (I can just set name, icon). Probably I'll have to do it specifically for each platform (let's say iOS is enough), but in a way that I can control badge value from shared code- I need the badge to have value of count of list items (list is inside that tab), so I'll need to update it as the list is changing.
Any suggestions? Thanks!
Only things that exists on both iOS and Android platforms are implemented in Xamarin.Forms. And it seems like there are no badges out of the box for Android.
But you still can implement a custom renderer for your TabBarItem which will use the iOS badge and some Android library for this.