I'm in the need of a back end solution for my new app.
I need a solution where the owner of the app can log into and change the data.
Word press Login And Data change By Owner?
Both Master and Detail not appearing on iOS 13 on the tablet.
Hello,
I got a problem with the MasterDetailView on the newest iOS 13. My app suddenly has problem when I updated my device to iOS 13 . I worked fine before. I made a small test project using the following code:
public App()
{
InitializeComponent();
var md = new MasterDetailPage()
{
Master = new Page() { Title = "Meester", BackgroundColor = Color.Red },
Detail = new Page() { Title = "Leerling", BackgroundColor = Color.Green }
};
MainPage = md;
}
I still have the same problem.
Behaviour on Mobile:
View behaves as intended
The detail page that opens is Green.
When swiped from the left the detail page appears and this has the correct color Red.
Behaviour on Tablet
Bothe the master and detail keep being white and appear to have a size of -1, -1.
If i use contentpages the content of the pages is there in the object but just has no size.
I cannot find relevant information in the release notes of iOS 13. Does anybody know what the problem is?
Xamarin Form Shell Page with backbutton
I have the flyout item set out as below. The issue is, Why is default hamburger icon not changed to the back arrow when About page is clicked. If i call the About page from a button in TabPageOne (via Navigation.PushAsync(new AboutPage()) then the back arrow appears.
Xamarin Forms v 4.1.0.778454
Windows VS 2019 v16.3.1
<FlyoutItem Route="Main" FlyoutDisplayOptions="AsSingleItem" Title="Main" >
<Tab Title="Tab One" Route="tabone" >
<ShellContent ContentTemplate="{DataTemplate local:TabPageOne}" />
</Tab>
<Tab Title="Tab Two" Route="tabtwo">
<ShellContent ContentTemplate="{DataTemplate local:TabPageTwo}" />
</Tab>
<Tab Title="Tab Three" Route="tabthree" >
<ShellContent ContentTemplate="{DataTemplate local:TabPageThree}" />
</Tab>
</FlyoutItem>
<FlyoutItem Title="Profile" >
<ShellContent Title="Profile" ContentTemplate="{DataTemplate local:ProfilePage}" />
</FlyoutItem>
<FlyoutItem Title="Key" >
<ShellContent Title="Key" ContentTemplate="{DataTemplate local:KeyPage}" />
</FlyoutItem>
<FlyoutItem Title="About">
<ShellContent Title="About" ContentTemplate="{DataTemplate local:AboutPage}" />
</FlyoutItem>
//AboutPage.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="MyApp.View.AboutPage" NavigationPage.HasBackButton="True" NavigationPage.HasNavigationBar="True">
<ContentPage.Content>
<StackLayout Orientation="Vertical" VerticalOptions="CenterAndExpand">
<Label Text="MyApp" FontSize="Large" FontAttributes="Bold" HorizontalOptions="CenterAndExpand"/>
<Label Text="Powered with Xamarin" FontSize="Medium" HorizontalOptions="CenterAndExpand" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
Forms iOS: System.Net.WebException: Error: ConnectFailure (Connection timed out)
One of our apps, which used to work fine until recently, has some kind of connection issue with an API service.
Since this is Forms, we tried on Android, which works fine, but on iOS we get a rather large error prompt (attached file).
We know well that on the Info.plist file on the iOS section of our app we have to specify which URLs are allowed and whatnot
(that 'NSAppTransportSecurity' chunk of text we see around the net), but nothing, even after we allowed the 24 required URLs.
If anyone has had this problem and found a solution, we'll be glad to hear it and give it a try.
Thanks in advance and kind regards.
ManuelR
P.S.: Added tags
Linking assemblies nightmare - Xamarin Forms - Android error
Hello, it's been a while since I did not have this kind of problem : building the app in release mode with a linking mode differentt to none throws an error which I'm unable to get rid off (neither SDK only nor SDK and User assemblies options work).
Here is the error I got while compiling (notice that I can't deploy and thus open device log to see advanced/more verbal logs.
System.InvalidCastException: Unable to cast object of type 'System.Byte' to type 'System.String'.
at Mono.Cecil.MetadataBuilder.GetConstantSignature(ElementType type, Object value)
at Mono.Cecil.MetadataBuilder.AddConstant(IConstantProvider owner, TypeReference type)
at Mono.Cecil.MetadataBuilder.AddField(FieldDefinition field)
at Mono.Cecil.MetadataBuilder.AddFields(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddTypes()
at Mono.Cecil.MetadataBuilder.BuildTypes()
at Mono.Cecil.MetadataBuilder.BuildModule()
at Mono.Cecil.MetadataBuilder.BuildMetadata()
at Mono.Cecil.ModuleWriter.<>c.b__5_0(MetadataBuilder builder, MetadataReader _)
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func3 read) at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata) at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable
1 stream, WriterParameters parameters)
at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
at Mono.Cecil.AssemblyDefinition.Write(String fileName, WriterParameters parameters)
at Mono.Linker.Steps.OutputStep.WriteAssembly(AssemblyDefinition assembly, String directory, WriterParameters writerParameters)
at Mono.Linker.Steps.OutputStep.OutputAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.OutputStep.ProcessAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.BaseStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
I don't see any clue on the project or the dll that is messing my project.
I've tried the linking.config approach where you specify a linker.description which is supposed to say to the compiler "don't touch those dll". But didn't manage to make it work.
At first, I thought it might be some dependencies not working but I found an old backup (6months ago) and it builds well in release mode with linking mode set to SDK only. I've tried to upgrade every packages from the project to match the packages' version I use in my project (the latest version). The old project seems to still compile fine in release mode with linking assemblies set to SDK...
I'm a bit lost. It's hard to find which dependencies got a problem since I need to do a ton of merge and additional work if I want to use the latest updates. I've tried to find some additional info on the web but couldn't find any tips.
I need help because my project goes from (linking SDK only) 66mo to 119mo. The gap is huge and I would like to release some updates without increasing the size by 80%... Users will think I've added massive new features whereas I did not
Any help or feedback on how you made it working will be much appreciate.
Thanks for reading so far.
If you a need any further information to help me, let me know ! Thanks again and have a good day.
How to Check Location on Device is enabled or not in Xamarin forms
Hi Guys,
I am trying to develop an Application which includes Maps, How to Check Location on Device is enabled or not in Xamarin forms
Thanks in Advance
Shell possible memory leak
Hi everyone.
Using Shell, whenever I navigate from a tab to a details page (that is registered to Shell Routes), a new instance of that page is created. But, when I leave this page the finalizer is never called, it seems to be held in memory forever. This page is an empty ContentPage, I set Content = null after popping, and I even used a GC.Collect(1, GCCollectionMode.Forced, false), but nothing.
Am I doing something terribly wrong? Is there a way that I can remove any references of the page left?
Thank you
Youtube video bar not proper position??
Now i Use WebView Embedded video my application, live video properly play . their bar should be positon end side,but its positon is normally back side
you can seee link bar in picture
any help me
XF 4: CollectionView GridItemsLayout with bindable Span property
When I try and bind the GridItemsLayout Span property to the ViewModel, it doesn't work.
See sample project (open CollectionViewPage from landing page):
https://github.com/InquisitorJax/Xamarin-Forms-4-Layouts
Is this by design - or a bug?
Display Alert within context action needs a cast type?
I'm working on a lab for a class, the final step is adding a context button to the listview we've created in a previous step. I'm trying to get an alert to pop up when the button has been pressed, but I kept getting an error. I finally copied a bit of code from the instructor but after running it I'm getting an invalid cast type. Can someone explain both how to fix the issue, and why a cast type is necessary?
Code before instructor:
var button = new Button //ListButton // Android workaround
{
Text = "Buy Now",
BackgroundColor = Color.Orange,
FontSize = 12,
HorizontalOptions = LayoutOptions.EndAndExpand
};
button.SetBinding(Button.CommandParameterProperty, new Binding("."));
button.Clicked += async (sender, e) =>
{
var b = (Button)sender;
var item = (ListItem)b.CommandParameter;
await DisplayAlert("Error", "You must first select a payment option", "OK");
if (info.getName() == "")
{
await ((ContentPage)b.Parent).DisplayAlert("Error", "You must first select an item", "OK");
}
else if (info.getPaymentSelected() == 0)
{
await DisplayAlert("Error", "You must first select a payment option", "OK");
}
else
{
await DisplayAlert("Order Summary", "Payment Processing", "OK");
}
};
Code after instructor:
var button = new Button //ListButton // Android workaround
{
Text = "Buy Now",
BackgroundColor = Color.Orange,
FontSize = 12,
HorizontalOptions = LayoutOptions.EndAndExpand
};
button.SetBinding(Button.CommandParameterProperty, new Binding("."));
button.Clicked += async (sender, e) =>
{
var b = (Button)sender;
var item = (ListItem)b.CommandParameter;
await ((ContentPage)((Grid)((ListView)((StackLayout)b.Parent).Parent).Parent).Parent).DisplayAlert("Error", "You must first select a payment option", "OK");
if (info.getName() == "")
{
await ((ContentPage)b.Parent).DisplayAlert("Error", "You must first select an item", "OK");
}
else if (info.getPaymentSelected() == 0)
{
await ((ContentPage)((ListView)((StackLayout)((StackLayout)b.Parent).Parent).Parent).Parent).DisplayAlert("Error", "You must first select a payment option", "OK");
}
else
{
await ((ContentPage)((ListView)((StackLayout)((StackLayout)b.Parent).Parent).Parent).Parent).DisplayAlert("Order Summary", "Payment Processing", "OK");
}
};
Plugin Mapsui. Collision for LabelStyle don't working.
Hello guys!
After reading issue #383 and #536 on the git. if I understand right, I must create own render Label with collision.
But i wanna to know maybe there is new information about issue or example (Mapsui for Xamarin.Forms).
Thanks all for feedback.
https://github.com/Mapsui/Mapsui/issues/383
https://github.com/Mapsui/Mapsui/issues/536
Dynamic styles
Hello,
In my application I created a class which scales the application based on Width height and dpi of the device. Currently I use binding to a lot of xaml element's width and height. I have a problem with slow loading therefore I would like to change this aproach. Scaling works 100% its just slow.
My question is: Is it possible to generate .css file which would take width heigh dpi at the startup and calculate new values. Then use this Css and avoid using bindings.
Example:
// this is static
body{
width:300px;
height:200px;
}
// this is dynamic
// widthModifier=0,5;
// heightModifier=0,3;
body{
width:300 * widthModifier; //150px
height:200 * heightModifier; //60px
}
If not .css then maybe xaml styles.
Have anybody tried to do this before?
How do I return to the login page from Shell?
Hi everyone !
The flow of my application is as follows;
Phone Entry Page --> Register --> SmsConfirmation -->MainPage(Shell)
When I go to the profile page in Shell and press the exit button, I return to the phone entry page. ---> IT'S OKEY
If I log in with the same phone number, I go directly to the main page. ---> IT'S OKEY
If I enter another number, I naturally have to go to the register page. ---> IT'S OKEY
But, Right here, when I enter another phone number and go to the register page, I get a black screen error. ---> PROBLEM
There is no problem when I do not come to the Register screen from exit button. So I am not getting a black screen error.
Please help me !!
ProfilePage.cs
void ExitAccount(object sender, System.EventArgs e)
{
Helpers.Settings.GeneralSettingsPass = string.Empty;
Helpers.Settings.GeneralCustomerNo = string.Empty;
Device.BeginInvokeOnMainThread(() => Application.Current.MainPage = new NavigationPage(new PhonePage()));
PopupNavigation.Instance.PopAsync();
}
PhoneEntryPage.cs
async void GoUserInfo(Object sender, System.EventArgs e)
{
if (EntryPhoneNumber.Text == customerModel.MobileGsm && Helpers.Settings.GeneralCustomerNo == customerModel.CustomerNo)
Device.BeginInvokeOnMainThread(() => Application.Current.MainPage = new MainPage());
else
{
string validPhone = @"^(05(\d{9}))$";
Regex rxPhone = new Regex(validPhone);
if (EntryPhoneNumber.Text == null)
await DisplayAlert("UYARI", "Cep numarası alanı boş geçilemez", "Tamam");
else if (rxPhone.Match(EntryPhoneNumber.Text).Success)
{
ServiceManager manager = new ServiceManager();
var result = await manager.GetGsm(EntryPhoneNumber.Text);
if (result)
{
Helpers.Settings.GeneralSettingsPass = EntryPhoneNumber.Text;
customerModel = await manager.GetCustomerUpdatedInfo(Helpers.Settings.GeneralSettingsPass);
CrossSettings.Current.AddOrUpdateValue("Information", JsonConvert.SerializeObject(customerModel));
await Navigation.PushPopupAsync(new LoginPopUpPage());
}
else
await Navigation.PushAsync(new UserEntryPage(EntryPhoneNumber.Text));
}
else
await DisplayAlert("UYARI", "Lütfen numaranızı 05xx xxx xx xx formatında tuşlayınız", "Tamam");
}
Helpers.Settings.GeneralSettingsPass = EntryPhoneNumber.Text;
}
Listview Selected Item Background Color
Is it possible to set the ListView selected item background color? Right now on IOS its gray and I want it to be transparent if possible.
Design Time Property in Custom Control
Hi there,
When using the XAML Previewer it is possible to enter design time data using "d:". For example "d:Text="Hello"" on a Label would show this text in the Previewer. I am unable to get this working with properties in custom controls though. Does anyone know how to do this?
Many thanks!
Will
CollectionView - reusing view issue?
Hi there,
I have a CollectionView where each item has a bound list (of between 1 and 5 items) in a BindableStackLayout control (don't recall where I found the source for that one... but it's a a small list of items bound to an IEnumerable property in my ViewModel).
When i scroll backwards and forwards within my CollectionView, the bound items start to duplicate, e.g. the first item in my CollectionView starts out with 1 item within it's BindableStackLayout, but then after scrolling down and back up, it might have 2 or more.
I've had a bit of a read and suspect that this might be something to do with the way the CollectionView is re-using views behind the scenes and things are all getting muddled.
Has anyone else encountered this? I tried binding all my data using some nested BindableStackLayout controls, but without the virtualisation, the performance was too poor for the quantity of items i was rendering (300+) - performance is spot on with CollectionView, but given it's not working as i'd hoped, i'm a bit stuck.
Any pointers would be much appreciated
thanks,
Andrew
Android : ImageLoaderSourceHandler: Could not retrieve image or image data was invalid: Uri:
I have always this problem to load image from url on Android device and simulator:
ImageLoaderSourceHandler: Could not retrieve image or image data was invalid: Uri:
for test i simply put :
Imag.Source = .....
but nothing happen....
I already tried all the combination for HttpClient and SSL/TLS in Android project settings
Do anyone know hot to solve this?
tks
Screenshot location on Android emulator (Windows+ Visual Studio 19)
Hi folks!
I can not find the screenshot location for my Android emulator on Visual Studio (Windows).
So how do I get the screenshots?
Thanks in advance!
BR
Janos
'Could not AOT the assembly '...'' build error in iOS version of Xamarin forms app
When trying to build a Xamarin forms application with as device 'iPhone', the following error comes up:
"/Users/{UserBuildHost}/Desktop/{AppName}/{AppName}/{AppName}/{AppName}.iOS/MTOUCH: Error MT3001: Could not AOT the assembly '/Users/{UserBuildHost}/Desktop/{AppName}/{AppName}/{AppName}/{AppName}.iOS/C:/Projects/MyApp/mtouch-cache/3-Build/{AppName}.iOS.exe' (MT3001) ({AppName}.iOS)"
I really don't know what the problem could be. Maybe something with the colon in the MONO_PATH (see output.txt)?
The error is thrown in release mode, when using 'iPhone' as device. Using debug throws the error "'ReadItemsFromFile' task failed unexpectedly". I can make a seperate thread about that error if necessary.
I included the full, diagnostic build-log (output.txt) and the list of installed nuget packages (nuget.txt).
Any help on how to fix this would be greatly appreciated.
How to properly set Easing in XAML?
Hi!
I have a custom control with Easing bindable property.
public static readonly BindableProperty AnimationEasingProperty = BindableProperty.Create(nameof(AnimationEasing), typeof(Easing), typeof(BreadCrumb), Easing.CubicInOut, BindingMode.TwoWay);
public Easing AnimationEasing
{
get { return (Easing)GetValue(AnimationEasingProperty); }
set { SetValue(AnimationEasingProperty, value); }
}
When I add my control to page I have Error:
No property, bindable property, or event found for 'AnimationEasing', or mismatching type between value and property.
<breadcrumb:BreadCrumb ... AnimationEasing="SinIn"/>
How can I properly set value to AnimationEasing property?