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

Landscape Mode for one page only in Forms 1.3+ in iOS

$
0
0

I need to force landscape mode only on a few pages in my app. Previously I created a Landscape controller in my iOS project that I used to make this happen. However, with the changes in the Application class in Forms 1.3, this no longer works.

Does anyone have a solution for how to accomplish this now?


"LinkAssemblies task failed" after upgrade to Xamarin Forms 1.3.4

$
0
0

I just used Nuget to upgrade my Xamarin Forms from 1.0.6186 to version 1.3.4. This project which was functional, will now no longer compile. It is a fairly vanilla install of VS2013/Xamarin. Nothing outside of the basic install.

When I compile, I get the following error:

Error 1 The "LinkAssemblies" task failed unexpectedly.
Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'System.Void Android.Widget.AbsListView::SetSelectionFromTop(System.Int32,System.Int32)' (defined in 'Xamarin.Forms.Platform.Android, Version=1.3.4.0, Culture=neutral, PublicKeyToken=null') from 'Xamarin.Forms.Platform.Android, Version=1.3.4.0, Culture=neutral, PublicKeyToken=null' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Android.Widget.AbsListView::SetSelectionFromTop(System.Int32,System.Int32)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
--- End of inner exception stack trace ---
at Xamarin.Android.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext() HealthTechnologies.Android


I have followed the guidance in this article, and made these updates: http://developer.xamarin.com/guides/cross-platform/macios/updating-xamarin-forms-apps/

Any suggestions on how to resolve this would be greatly appreciated.

Thanks,
Rick

Cannot deploy the application on my iPAD

$
0
0

Hi ,

I am getting the following error while deploying the application. I have followed the steps mentioned to create certificates, provisioning profiles etc.

the error message is

writeDictToFile:1249 open failed for /Users//Projects/People/iOS/obj/iPhone/Debug/mtouch-cache/install-shadow-directory/c90e2058cf58765ec4a6a39537a9a4db/106340108f089675c637ce04db8b47228591bf2f/ManifestCache.plist : No such file or directory
MDMCacheDirectoryManifest:1323 writeDictToFile failed to write to /Users//Projects/People/iOS/obj/iPhone/Debug/mtouch-cache/install-shadow-directory/c90e2058cf58765ec4a6a39537a9a4db/106340108f089675c637ce04db8b47228591bf2f/ManifestCache.plist : No such file or directory
error MT1006: Could not install the application '/Users//Projects/People/iOS/bin/iPhone/Debug/PeopleiOS.app' on the device Pratik's iPad: Your code signing/provisioning profiles are not correctly configured. Probably you have an entitlement not supported by your current provisioning profile, check the iOS Device Log for details (error: 0xe8008016).
failed to suspend thread 0xb0217000 due to Thread is detaching, hopefully it is dead

What could be the solution? Please let me know. I am trying to this for a while now

Custom WebView Renderes is called, but Delegate is not working

$
0
0

I defined a delegate for a Custom WebView Renderer and assigned it – but the override methods are never called. Below my code. Any idea?
Thanks for any help.

using Xamarin.Forms.Platform.iOS;
using Xamarin.Forms;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using System.Diagnostics;
using System;

[assembly: ExportRenderer (typeof (tg.CustomWebView), typeof (tg.iOS.CustomWebViewRenderer))]

namespace tg.iOS
{

public class CustomWebViewRenderer: WebViewRenderer
{
    // ok - Get's called !
    public CustomWebViewRenderer ()
    {
        Debug.WriteLine ("CustomWebViewRenderer ()");
        this.Delegate = new MyCustomWebViewDelegate();
        this.LoadUrl ("http://www.google.ch");

        // does not work:
        //this.ShouldStartLoad = delegate (UIWebView webViewParam, NSUrlRequest request, UIWebViewNavigationType navigationType) {
        //  Debug.WriteLine("ShouldStartLoad");
        //  return false;
        //} ;

    }


    public class MyCustomWebViewDelegate : UIWebViewDelegate
    {
        // get's never called:
        public override bool ShouldStartLoad (UIWebView webView, NSUrlRequest request, UIWebViewNavigationType navigationType)
        {
            Debug.WriteLine("ShouldStartLoad");
            return false;
        }

        public override  void LoadFailed (UIWebView webView, NSError error)
        {
            Debug.WriteLine("Entered");
        }


        public override  void LoadingFinished (UIWebView webView)
        {
            Debug.WriteLine("Entered");
        }


        public override  void LoadStarted (UIWebView webView)
        {
            Debug.WriteLine("Entered");
        }

    }
}

}

Xamarin.FormsMaps.Init() does not exist in the namespace Xamarin

$
0
0

This is in the AppDelegate.cs class. After I upgraded to unified api.
The version of Xamarin.Forms: 1.3.5.6333-pre1
Xamarin.Forms.Maps: 1.3.0.6292

I have the same reference in in m Android project and it works fine.

XF Lab CheckBox and Radio controls

$
0
0

I am using these two controls (checkbox and radio button) but they don't get displayed on the content page. Is there any tutorial on how to use them?

are nuget packages duplicated in forms projects?

$
0
0

I now have the habit of adding the nuget packages to my forms PCL and iOS libraries. Does this mean the nuget packages are duplicated in the final binary, or do they all get resolved down once?

is there any info out there about how libraries and dependencies get compiled down, and any optimizations that take place?

thanks

What is MKOverlayWrapper? It's breaking my map renderer...

$
0
0

After updating to the Unified API, I started seeing a MKOverlayWrapper being passed into a method in my custom MapRenderer:

public override MKOverlayRenderer OverlayRenderer(MKMapView mapView, IMKOverlay overlay)

The second parameter (IMKOverlay) is now of type MKOverlayWrapper, and there is no way to cast an MKOverlayWrapper to the type of my actual overlays, MKPolyline. Anyone have an idea how to fix this?


Stripe Payment Component

$
0
0

Hey guys,

I am trying to add the Stripe component to my xamarin.forms iOS and Android app but I am getting this error message:

You are trying to install this package into a project that targets 'MonoAndroid,Version=v4.4', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

I tried adding different components but it gives me the same message, so i am assuming it has something to do with xamarin studio. (i am on mac)

Thanks for the help

Open File from PersonalFolder

$
0
0

In my application, I am downloading a PDF file (since there is no way to show PDF file in a webview) on Android to-

Environment.GetFolderPath (Environment.SpecialFolder.Personal);

Now I want to provide users the path to this folder so that they can browse and open the files-similar to when a file is downloaded in a chrome browser. How can I do that?

Thanks

NavigationService xamarin.forms

$
0
0

Hello,
So i would to ask you how can i navigate between 2 Xaml pages with mvvmlight (in portable project) those two xamls are binding their context from the Same view model (Main) ...
Thx for helping

Can't send an email from the app

$
0
0

Hello guys ! I am trying to send an email from my app. I am trying to do it with the DependencyService. For now I am implementing it for iOS only and I have the following warning : " ConsultantsApp.iOS[486:47185] Warning: Attempt to present on whose view is not in the window hierarchy! " . This is the code from my class:

public class IMailSender : UIViewController, MailSender
{

    MFMailComposeViewController mailController;

    public IMailSender()
    {

    }

    public void sendMail (string subject)
    {
        if (MFMailComposeViewController.CanSendMail) {
            mailController = new MFMailComposeViewController ();
            mailController.SetToRecipients (new string[]{"stefan@edenofapps.com"});
            mailController.SetSubject (subject);
            mailController.SetMessageBody ("this is a test", false);
            mailController.Finished += ( object s, MFComposeResultEventArgs args) => {
                Console.WriteLine (args.Result.ToString ());
                BeginInvokeOnMainThread (() => {
                    args.Controller.DismissViewController (true, null);
                });
            };
    };
        if (MFMailComposeViewController.CanSendMail) {
            this.PresentViewController (mailController, true, null);
        } else {
            new UIAlertView("Mail not supported", "Can't send mail from this device", null, "OK");
        }
    }
}

And this is my AppDelegate class:

    public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
        Forms.Init();

        window = new UIWindow(UIScreen.MainScreen.Bounds);

        window.RootViewController = App.GetMainPage().CreateViewController();

        window.MakeKeyAndVisible();

        return true;
    }

}

Thanks in advance ! :)

Creating an image gallery where each image is clickable?

$
0
0

Hello

I'm trying to work out the best way to create an image gallery where each image is clickable, on clicking the image the full size image will be displayed in a modal.

I'm not sure if I have to create a custom control, do I create a grid and add each thumbnail as an Image?

Pointers would be much appreciated.

Mark

Nokia_X

$
0
0

Hi,
anyone successfully using the Nokia_X with Xamarin forms - shows up for me as 'unsupported device', but works fine in a 'normal' Xamarin Android project

Thanks

Pete

Master Detail issue on Android

$
0
0

I'm trying to use this example to create a menu system -- https://syntaxismyui.com/xamarin-forms-masterdetail-page-navigation-recipe/

I downloaded the example at the bottom of the page and it works nicely. The problem is that in my new portable forms project it isn't working correctly for android. The menu stays open and clicking the menu icon does nothing.

Just to verify the issue I upgraded the xamarin nuget packages in the downloaded example to the newest version and it doesn't work on android. Is there something I should be doing differently now or is this an issue with this version ?

Thanks,

Bob


Can't add certain package to my app

$
0
0

Hey guys,

I am trying to add the Stripe package to my Xamarin.forms app but I am getting this error message:

Could not install package 'RestSharp 105.0.1'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

I read in several forums that this might be because of my NuGet version but I don't know how to manually update it, if this is really the problem ..

Thanks in advance ! :)

Try to pushasync a page in the detail of a masterdetail

$
0
0

Hi.
I've this situation.
A MasterDetail: in the master I have a button with this code
buttonVerifica.Clicked +=async (object sender, EventArgs e) => {
this.IsBusy = true;
var result = await BarCodes.Instance.Read();
if (!result.Success){
this.IsBusy = false;
await this.DisplayAlert("Failed", "Failed to get barcode", "OK");
}
else {
this.IsBusy = false;
App.MasterDetail.Detail = new NavigationPage (new PageDatiScontrino(result));
}
}
I would like to visualize a navigationpage in the Detail with data reads from the barcode.

I always open navigationPage in Detail page, but in this situation it does not appear.
It's not a problem of @AllanRitchie 's library. The problem, I suppose, is in the async / await situation.

This code sometimes work, sometimes not.

In XS's "Output application" nothing is write.

Some suggestions?
Thanks
Alessandro

Example of playing a sound in a Xamarin.Forms app, across iOS, Android and Windows Phone

$
0
0

I’ve not had any success so far at finding a Xamarin.Forms-based piece of code that plays a sound across iOS, Android and Windows Phone platforms. If anybody knows of one, could you point me towards it please? Even something as “simple” as adding a tick sound to one of the clock samples without blocking the UI thread would be a good enough example.

Many thanks,

John H.

Looking for payment method

$
0
0

Hey guys,

I am currently building a xamarin.Forms app for iOS and android. At the last screen of the app I need to have some kind of checkout which allows me to somehow transfer money in order to unlock the apps services. Since it is not digital content which is being unlocked, i would like to avoid using an in app payment. I guess I am hoping there'd may be a component or an easy way ?

Thanks!

Webview content disappears when orientation changes on Adnroid

$
0
0

Hi,

I've been using xamarin.forms but have ran across a bug on my phone devices, when it rotates the contents of the webview disappears. I added ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize to my main activity to keep my other views from reloading but webview seems to be loosing its content.

Interestingly the content height appears correct but nothing is shown. I am using the HtmlWebSource and tried to reload the html content just incase but nothing loads.

Have I missed something obvious?

Viewing all 52968 articles
Browse latest View live


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