Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 58056 articles
Browse latest View live

Displaying HTML as a label

$
0
0

Hi all,

I am trying to display the following html in a label:

<p>De 38-jarige zanger meldt op Twitter dat de operatie succesvol is verlopen. Hij laat daarbij weten dat hij zeven dagen niet mag praten. </p> <p>Vanwege zijn stembandproblemen moest de zanger al zijn komende optredens schrappen. Duijts zal waarschijnlijk weer vanaf 27 januari op het podium staan, blijkt uit de agenda op zijn werk. </p>"

It should look something like this:

Sometimes, there are links (href) inside of the HTML, these have to work as well.
Does anyone know a way to do this in Xamarin.Forms? :)


ResolveLibraryProjectImports

$
0
0

I have tried everything posted on the internet. If I can not solve it, I will have to give up xamarin and return to the classic. I expected more from Microsoft. A real shame

Severity Code Description Project File Line Suppression State
Error The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'MyApp, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'MyApp.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName)
at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res, ICollection1 jars, ICollection1 resolvedResourceDirectories, ICollection1 resolvedAssetDirectories, ICollection1 resolvedEnvironments)
at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() MyApp.Android

Icon Transparency is Ignored

$
0
0

Probably doing something silly...

Android Forms PCL Project, VS 2017, Forms 2.5
Not sure I can legally send you to the Play Store to show the real example due to policies beyond my control. Google Play listing, web browsers, common image viewing apps all view the image correctly with a transparent background.

Issue:
Icon Transparency is ignored within the app itself and there is a white box / outline everywhere instead. It shows the white box on the app menu in Android. It shows it on the toolbar, and anywhere the icon is referenced within the app. Using all of the standard sizes in the drawable folders, png files. I have pretty much the same issue with splash screens.

Basically: https://stackoverflow.com/questions/47956640/xamarin-icon-transparency-confusion

Is it possible to iterate through controls in code behind.

$
0
0

Hi,
I want if possible to iterate through all the controls, and do validation on the Entry fields on a page. In WP you can use VisualTree and iterate through using that - any way I can do it in Xamarin forms?

Thanks

Manually load views in Prism

$
0
0

I have a requirement to create dashboard or widgets in a Prism app. Basically you get a list of widgets based on your security level, you may only have access to x number of modules and within them, these modules can have to level navigation options (implemented) or a widget to present on the dashboard which has it's own viewmodel.

There's no nice way of loading in XAML like you can in WPF and it will have it's parent binding context etc.

I've been looking at different approaches for this, I thought of loading the views into a bindable collection and presenting then via a custom tileview control we have.

I found this post which involves creating your own region manager

http://stackoverflow.com/questions/28652090/xamarin-forms-dynamically-load-content-in-a-page

I was wondering if anyone has attempted this and if they run into memory management issues, as the dashboard is a details page in a masterdetail app it loads in and out of memory so I'd imagine I'd have to handle cleaning up the binding context of the views when the page is destroyed and any behaviors to allow navigation from the widget into modules.

I'm wondering if anyone has attempted something similar in Prism or in Forms in general

I know there's the dynamic forms nuget library but it hasn't been touched in a while and the Forms team don't seem to recommend that approach from what I saw on a Forum post.

Thought I'd ask before I spend a few weeks on it only to find out I've been a bit overambitious with Forms.

This app attempts to access privacy-sensitive data without a usage description

$
0
0

Hi,

Why I am getting these errors:

Dear developer,

We have discovered one or more issues with your recent delivery for "إيثار". To process your delivery, the following issues must be corrected:

Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data.

Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCalendarsUsageDescription key with a string value explaining to the user how the app uses this data.

Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data.

Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSAppleMusicUsageDescription key with a string value explaining to the user how the app uses this data.

Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSSiriUsageDescription key with a string value explaining to the user how the app uses this data.

Once these issues have been corrected, you can then redeliver the corrected binary.

Regards,

The App Store team

I never requested to access any of the above in my app?

and my packages are attached....

Kindly advise..

Thanks,
Jassim

Windows Store package upload error for WP 8.0

$
0
0

Hello,

I am trying to deploy a Windows Phone 8.0 Silverlight app to the app store (unfortunately we have the requirements to support this old version of WP).

I am getting this error when trying to upload the .xap package:

"Package acceptance validation error: We don’t allow embedded EXEs. Remove the roslyn\csc.exe embedded EXEs and then try again.
Package acceptance validation error: We don’t allow embedded EXEs. Remove the roslyn\csi.exe embedded EXEs and then try again.
Package acceptance validation error: We don’t allow embedded EXEs. Remove the roslyn\vbc.exe embedded EXEs and then try again.
Package acceptance validation error: We don’t allow embedded EXEs. Remove the roslyn\VBCSCompiler.exe embedded EXEs and then try again."

Please note that the app is built with Xamarin framework, using Xamarin Forms.

Does anyone know what's going on?

Thanks for your help,
Roland

Linking on iOS for Deployment

$
0
0

Hi,

In Linking on iOS article it was explained the difference between the three options:

  • Don't Link
  • Link SDK assemblies only
  • Link all assemblies

but which option I should use or what's the recommended option for iOS projects atthe time of deployment?

Thanks,
Jassim


Operator '==' cannot be applied to operands of type 'Task' and 'bool' (CS0019)

$
0
0

Hi,

How to avoid:

Error CS0019: Operator '==' cannot be applied to operands of type 'Task' and 'bool' (CS0019)

In below code?

public partial class AboutMerchant : ContentView
{
    public AboutMerchant()
    {
        InitializeComponent();

        if (!Application.Current.Properties.ContainsKey("ZeeraCustomerID"))
        {
            App.Current.MainPage = new NavigationPage(new ZeeraSignin());
        }
        else
        {
            // indicatorLoading.IsRunning = true;

            if (!Application.Current.Properties.ContainsKey("ZeeraMerchantNumber"))
            {
                App.Current.MainPage.DisplayAlert("Error", "You must select a merchant first.", "OK");
                Application.Current.MainPage.Navigation.PopAsync();
                return;
            }

            GetMerchantDetails Merchant = new GetMerchantDetails();

            if (Merchant.MerchantDetails(Convert.ToString(Application.Current.Properties["ZeeraMerchantNumber"])) == true)
            {
                // await DisplayAlert("Scanned Barcode", "EXISTS", "OK");

                // await Navigation.PushAsync(new ZeeraCategory());

                // this.Title = Convert.ToString(Application.Current.Properties["ZeeraMerchantName"]);

                var htmlSource = new HtmlWebViewSource();
                htmlSource.Html = Convert.ToString(Application.Current.Properties["ZeeraMerchantProfile"]);

                lblProfile.Source = htmlSource;

                loadingProfile.IsVisible = false;
                lblProfile.IsVisible = true;

                // GetCategory();
            }
            else
            {
                App.Current.MainPage.DisplayAlert("Error", "Unable to find merchant details.!\nCode: " + Convert.ToString(Application.Current.Properties["ZeeraMerchantNumber"]), "OK");
            }
        }
    }
}

My GetMerchantDetails is a Class:

using System;
using System.Threading.Tasks;
using Xamarin.Forms;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Net.Http;
using System.Net.Http.Headers;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Text.RegularExpressions;
using System.Net;
using System.Text;

namespace Zeera
{
    public class GetMerchantDetails
    {
        public async Task<bool> MerchantDetails(string merchant_number)
        {
            var client = new HttpClient();
            client.BaseAddress = new Uri("https://www.domain.com/ws/get_merchant_details.php?merchant=" + merchant_number);
            client.DefaultRequestHeaders.Accept.Clear();
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            HttpResponseMessage response = await client.GetAsync("https://www.domain.com/ws/get_merchant_details.php?merchant=" + merchant_number);

            if (response.IsSuccessStatusCode)
            {
                var data = await response.Content.ReadAsStringAsync();

                dynamic merchantdata = JsonConvert.DeserializeObject(data);

                if (merchantdata.ToString() == "False")
                {
                    return false;
                }
                else
                {
                    App.Current.Properties.Remove("ZeeraMerchantNumber");
                    App.Current.Properties.Remove("ZeeraMerchantGuid");
                    App.Current.Properties.Remove("ZeeraMerchantName");
                    App.Current.Properties.Remove("ZeeraMerchantProfile");
                    App.Current.Properties.Remove("ZeeraMerchantCountry");
                    App.Current.Properties.Remove("ZeeraMerchantEmail");
                    App.Current.Properties.Remove("ZeeraMerchantCurrency");
                    App.Current.Properties.Remove("ZeeraMerchantActive");
                    App.Current.Properties.Remove("ZeeraMerchantBlocked");

                    App.Current.Properties.Add("ZeeraMerchantNumber", merchantdata[0].merchant_number);
                    App.Current.Properties.Add("ZeeraMerchantGuid", merchantdata[0].merchant_guid);
                    App.Current.Properties.Add("ZeeraMerchantName", merchantdata[0].merchant_name);
                    App.Current.Properties.Add("ZeeraMerchantProfile", merchantdata[0].merchant_profile);
                    App.Current.Properties.Add("ZeeraMerchantCountry", merchantdata[0].country_code);
                    App.Current.Properties.Add("ZeeraMerchantEmail", merchantdata[0].email_address);
                    App.Current.Properties.Add("ZeeraMerchantCurrency", merchantdata[0].base_currency);
                    App.Current.Properties.Add("ZeeraMerchantActive", merchantdata[0].is_active);
                    App.Current.Properties.Add("ZeeraMerchantBlocked", merchantdata[0].is_blocked);
                    await App.Current.SavePropertiesAsync();

                    return true;
                }
            }

            return false;
        }
    }
}

Kindly help..

Thanks,
Jassim

[SOLVED] HELP: Trouble with Ordinary Differential Equation Library

$
0
0

The issue was that I was using points.ElementAt(i).X.Sum; instead of points.ElementAt(i).X.ToArray().ElementAt(1). The solutions to the functions were returned in an array.

Calling all cars.

Here's what I'm up against. I'm creating an app that simulates gravitational waves. I can simulate a simplified version of these events algebraically but to simulate the real interesting things, I need to use ODE's. And it needs to do a lot of calculations quickly.

The trouble is, I don't have the money to afford some $1000 math suite.

BUT, I did find a library that seemed perfect!
Microsoft OSLO: https://www.microsoft.com/en-us/research/project/open-solving-library-for-odes/

var sol = Microsoft.Research.Oslo.Ode.RK547M(
                            0,
                            new Vector(0.0, initDisplacement), 
                            (t, x) => new Vector(
                            x[1], //the first derivative of x is velocity
                            -Math.Pow(angFreq, 2) * x[0])); //The angular frequency squared times x as a function of time gives you the derivative of velocity (which is acceleration).


            var points = sol.SolveFromToStep(0.0, 10, stepSize).ToArray();

            double[] xBuffer = new double[points.Length];
            double[] yBuffer = new double[points.Length];
            for(int i = 0; i<points.Length; i++)
            {

                //adding the points based x,y to the series
                xBuffer[i] = points.ElementAt(i).T;
                yBuffer[i] = points.ElementAt(i).X.Sum;
            }

But when I tried to use it to graph Simple Harmonic Motion (SHM) as a test, the graph didn't look right. Displacement should never go over initial displacement in this representation of SHM but it does. Maybe I'm doing something wrong, but for the life of me, I don't know what it is.

So I was wondering... If there are any people better at math than me on here... could you take a look at that Microsoft Library and see if you could graph SHM? Or if you've ever made a Xamarin App that did a lot of complex math, recommend me a library?

I've tried Rychusoft.NumericalLibraries.Differential from NuGet which is amazing but won't work for what I need it for.

I've also tried this https://github.com/OlegJakushkin/CSharpOdeLibrary which would be perfect but it uses come C++ code that is called by C# and I can't get that to work either.

Thanks for checking this thread out,

Nick

TEditor not working in android

$
0
0

Hi Everyone.I am implementing TEditor in a project in xamarin forms.There are no errors in code and building successfully.It is working fine in Simulator.But in real devices the data is not getting typed and also the styles are not working.

The project contains MasterDetailPage in Android.Can anyone of you please give me an idea to get my problem solved.

Or

Any one please suggest me another Plugin or Component or Package for the replacement of TEditor.

Thanks in Advance

How to download a .docx and pdf file into the device and view all those files.

$
0
0

Hi,
I want to download more than one .docx/pdf files into my device via code behind and want to view all those files. how I can achieve that??

How can i put 6 icons in my App and each to receive Push Notification and badge

$
0
0

My App has a layout where i put 4 entry and 6 icons. Each icon receive PN and Badge inside it. How can i do this?

How do you use jamesmontemagno's Xamarin.Plugins Settings?

$
0
0

I cannot find any sample code or instructions on how do use this plugin.

All it says in the readme is:

"Open up Helpers/Settings.cs in your PCL for directions on how to use. *"

What does that even mean? I don't have any file called Settings.cs in my PCL after installing from Nuget...

Thanks!

How to use all length of device using entry

$
0
0

I have some entrys in my app. I'd like to use all extension of my App. See image below

The entrys doesn't take all extesion. How can i do?


Azure - Free popular products for 12 months

$
0
0

Hello, Xamarin Community !

I am developing social app and I tried to use Azure. I successfully created my account and it works fine but I have one question.
I have activated free trail for 30 days with 170 € credit. Now they have special offer to get popular products for free for 12 months for free. Will it upgrade after free trail automatically or it works only with credit ?

Thanks for all your answers !!!

CarouselPage with progress bar

$
0
0

I have a registration page that has too many fields, that requires me to divide it into 4 pages,
I thought that the best experience is to have a CarouselPage with four ContentPages, that can be easily navigate through, and yet having one view with a corresponding view model.
Before asking the main question, I want to make sure that I'm taking the right decision, and I didn't miss any other option that is dedicated for such case that I'm not aware of (I'm still in my first steps in Xamarin).
if the CarouselPage is the way to go, then I want to have some indicator on the bottom of the screen, that shows the registration progress like a progress bar that increases by 25% on every next page, something that ties all the ContentPages together

Adding advertisement to Xam.Forms

$
0
0

Good day.
I've got my first Xamarin.Forms app, and before publishing it want to add advertisement banner to it. So I tried to find manual to do this, but unsuccessful.
The problem is that there are a lot of manuals to do this with Droid apps. Tried to use this https://montemagno.com/xamarinforms-google-admob-ads-in-android/ using Google Play Ads, but it do not work. So can someone tell me where can I find good instruction? how to to this?

How can I set a Forms ListView's ViewCell properties when it created?

$
0
0

i read this article(www.c-sharpcorner.com/article/showing-data-in-listview-with-api-using-xamarin-forms),i want according title length to set label color when create,example < 50 label is red, >= 50 label is black,how to solution?
plz help me

ReSharper Warning : Invalid type: expected type is 'double', actual type is 'OnPlatfrom'

$
0
0

Hi

I'm getting ReSharper warning in my XAML file as Invalid type: expected type is 'double', actual type is 'OnPlatfrom'.

I have changed my code from old (deprecated) method

<OnPlatform x:TypeArguments="x:Double" iOS="60" Android="40" WinPhone="40" />

To

<OnPlatform x:TypeArguments="x:Double">
    <On Platform="iOS" Value="60" />
    <On Platform="Android" Value="40" />
    <On Platform="WinPhone" Value="40" />   
</OnPlatform>

One main problem is that its not accepting the changes. So I revert back to the old one to make it work out.

I don't know its a valid warning. Correct me if I made anything wrong or tell me some solution. Thanks.

Viewing all 58056 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>