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

Is localization of RESX resources handled automatically now?

$
0
0

I have a localized Xamarin.Forms app. Originally (late 2016) I had followed the official localization guide by defining an ILocalize interface, implementing that in platform projects to get the platform-specific locales and convert to .NET cultures, and using DependencyService to get the correct implementation before setting the culture during app startup. But during a recent major refactor, I temporarily removed all the localization code and discovered that all the correct strings from the RESX files still seem to be used according to the device language settings in both Android and iOS.

Did I miss Xamarin.Forms getting automatic handling of locales in some update or another? Is the guide I linked to (or at least the parts concerning ILocalize etc.) outdated?


x:DataType doesn't exist

$
0
0

In the recent Xamarin blog post DataBinding Power Moves You May Not Be Using (Yet), David Ortinau uses x:DataType for compiled bindings. Unfortunately, x:DataType doesn't seem to exist for me. Here's an almost verbatim copy of the code in the post:

I am using Xamarin.Forms 2.4.0.282. Am I doing something wrong?

Can you have a scrollview in a scrollview?

$
0
0

I have a carousel page that has 4 content pages. 2 of the pages require that i create a "lookup" entry box and brings up data as the user is typing. I'm doing this via a webservice call and populating the data into a grid thats visibility is controlled by a boolean.

What I need is the lookup grid to be in a scrollview with a fixed height so that i can scroll through the results. My issue is that all this content is already inside of a scrollview.

so I have something like this in a single content page. this one is kind of complicated.

<stacklayout> <grid/> <grid/> <scrollview> <stacklayout> <grid/> <grid> <scrollview> <Devexpress grid/> <scrollview/> <stacklayout/> <scrollview/> <grid/> <stacklayout/>

the devexpress grid displays and works the way i need it to but it will not scroll through its items.

Is this even possible?

Thanks in advance for any help!

Using Android xml in Xamarin Forms

$
0
0

I'm creating a custom keyboard (eventually for iOS also) and the only resource I found was this GitHub project. After working on it for a bit I got it working..however this project is only Android and isn't cross platform. I tried making it work with PCL using renderers but it kind of requires two pieces to talk to each other:

           // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            mKeyboard = new Keyboard(this, Resource.Xml.keyboard2);
            mTargetView = (EditText)FindViewById(Resource.Id.target);

            mKeyboardView = (CustomKeyboardView)FindViewById(Resource.Id.keyboard_view);
            mKeyboardView.Keyboard = mKeyboard;

            mTargetView.Touch += (sender, e) =>
            {
                Log.Info("onTouch", "true");
                mTargetView.RequestFocus();
                ShowKeyboardWithAnimation();

                e.Handled = false;
                mTargetView.ShowSoftInputOnFocus = false;
            };

            mTargetView.FocusChange += (sender, e) =>
            {
                if (!mTargetView.IsFocused)
                {
                    mKeyboardView.Visibility = ViewStates.Gone;
                }
            };

            mKeyboardView.Key += (sender, e) => {
                long eventTime = JavaSystem.CurrentTimeMillis();
                KeyEvent ev = new KeyEvent(eventTime, eventTime, KeyEventActions.Down, e.PrimaryCode, 0, 0, 0, 0, KeyEventFlags.SoftKeyboard | KeyEventFlags.KeepTouchMode);

                this.DispatchKeyEvent(ev);
            };

There's a lot of pieces to account for..I'm not sure if I can get them all talking to each other correctly inside renderers. Is it possible to essentially delegate a ContentPage out to an Android xml? Or is there another solution for what I'm trying to do?

Navigation using TabbedPage ToolbarItems

$
0
0

Okay, so I have changed my applications format from using a TabbedPage inside a NavigationPage to using multiple NavigationPages within my TabbedPage. Unfortunately, this has rendered my ToolbarItems unusable since I can no longer perform navigation on the Clicked event.

Is the only way to fix this to revert to my previous set up (which was apparently against best practice)? The only reason I changed was in order to support a titleIcon in the navigation bar.

FirebaseAuthentication.net causing build to fail

$
0
0

I'm really new to Xamarin and have been trying to get the FirebaseAuthentication.net (sorry i cant post links yet) library to work with a Xamarin.Forms project ; I added it as a dependency to my PCL and I get the error

 Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Firebase.Auth, Version=1.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Firebase.Auth.dll'
  at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters) [0x00099] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:220
  at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference) [0x00000] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:170
  at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver resolver, System.Collections.Generic.ICollection`1[T] assemblies, Mono.Cecil.AssemblyDefinition assembly, System.Boolean topLevel) [0x0015c] in <593a6fd557984367bb21e275d0fa0659>:0
  at Xamarin.Android.Tasks.ResolveAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver resolver) [0x0019c] in <593a6fd557984367bb21e275d0fa0659>:0  (firenotes.Droid)

when I tried to build. I have tried changing project target to .NET standard, but that hasn't helped either. Couldanyone point me in the right direction, thanks

Xamarin.Forms HybridWebview callback function after redirect

$
0
0

I have a hybridwebview with:

webview.RegisterAction(data => Executefrombrowser(data));

      public void Executefrombrowser(string data) {
            if (data == "loaded") {
                Task.Run(() =>
                  StopLoading()
                     );
            }
            if (data == "success") {
                Task.Run(async () =>
                {
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        Application.Current.MainPage = new SocialTab();
                    });
                });
            }
        }

It is working for first loaded url but doesn't work after redirect.

I have a button on the first loaded page that redirects the page,

and i have the same javascript functions for calling C# on the second page but it is not working.

My hybridwebview structure: OHWebChromeClient.cs (in .Android)

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    using Android.App;
    using Android.Content;
    using Android.OS;
    using Android.Runtime;
    using Android.Views;
    using Android.Widget;
    using Android.Webkit;
    using Mono;
    namespace App101.Droid
    {
        public class OHWebChromeClient : WebChromeClient
        {

            private IValueCallback mUploadMessage;
            private static int FILECHOOSER_RESULTCODE = 1;

            public override bool OnJsAlert(Android.Webkit.WebView view, string url, string message, JsResult result)
            {
                return base.OnJsAlert(view, url, message, result);
            }

            public override void OnReceivedTitle(Android.Webkit.WebView view, string title)
            {
                base.OnReceivedTitle(view, title);
            }
            public override bool OnCreateWindow(Android.Webkit.WebView view, bool isDialog, bool isUserGesture, Message resultMsg)
            {
                return true;
            }

            private void OnActivityResult(int requestCode, Result resultCode, Intent data)
            {
                if (requestCode == FILECHOOSER_RESULTCODE)
                {
                    if (null == mUploadMessage)
                        return;
                    mUploadMessage.OnReceiveValue(WebChromeClient.FileChooserParams.ParseResult((int)resultCode, data));
                    mUploadMessage = null;


                }
            }

            [Android.Runtime.Register("onShowFileChooser", "(Landroid/webkit/WebView;Landroid/webkit/ValueCallback;Landroid/webkit/WebChromeClient$FileChooserParams;)Z", "GetOnShowFileChooser_Landroid_webkit_WebView_Landroid_webkit_ValueCallback_Landroid_webkit_WebChromeClient_FileChooserParams_Handler")]
            public override bool OnShowFileChooser(Android.Webkit.WebView webView, IValueCallback filePathCallback, FileChooserParams fileChooserParams)
            {
                var appActivity = Xamarin.Forms.Forms.Context as MainActivity;
                mUploadMessage = filePathCallback;
                Intent chooserIntent = fileChooserParams.CreateIntent();
                appActivity.StartActivity(chooserIntent, FILECHOOSER_RESULTCODE, OnActivityResult);
                //return base.OnShowFileChooser (webView, filePathCallback, fileChooserParams);
                return true;
            }

            protected void openFileChooser(IValueCallback uploadMsg, String acceptType)
            {
                mUploadMessage = uploadMsg;
                Intent i = new Intent(Intent.ActionGetContent);
                i.AddCategory(Intent.CategoryOpenable);
                i.SetType("image/*");
                startActivityForResult(Intent.CreateChooser(i, "File Browser"), FILECHOOSER_RESULTCODE);
            }

            private void startActivityForResult(object p, int fILECHOOSER_RESULTCODE)
            {
                throw new NotImplementedException();
            }





        }
    }

HybridWebViewRenderer.cs (in .Android)

    using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Xamarin.Forms;
using App101;
using App101.Droid;
using Xamarin.Forms.Platform.Android;
using Android.Webkit;
using Java.Interop;

[assembly: ExportRenderer(typeof(HybridWebView), typeof(HybridWebViewRenderer))]
namespace App101.Droid
{
    public class HybridWebViewRenderer : ViewRenderer<HybridWebView, Android.Webkit.WebView>
    {
        const string JavaScriptFunction = "function invokeCSharpAction(data){jsBridge.invokeAction(data);}";

        protected override void OnElementChanged(ElementChangedEventArgs<HybridWebView> e)
        {
            base.OnElementChanged(e);

            if (Control == null)
            {
                var webView = new Android.Webkit.WebView(Forms.Context);
                webView.Settings.JavaScriptEnabled = true;
                webView.Settings.AllowFileAccess = true;
                webView.Settings.AllowContentAccess=true;
                webView.SetWebChromeClient(new OHWebChromeClient());
                SetNativeControl(webView);
            }
            if (e.OldElement != null)
            {
                Control.RemoveJavascriptInterface("jsBridge");
                var hybridWebView = e.OldElement as HybridWebView;
                hybridWebView.Cleanup();
            }
            if (e.NewElement != null)
            {
                Control.AddJavascriptInterface(new JSBridge(this), "jsBridge");
                Control.LoadUrl(string.Format(e.NewElement.Uri, Element.Uri));
                InjectJS(JavaScriptFunction);
            }


        }


        void InjectJS(string script)
        {
            if (Control != null)
            {
                Control.LoadUrl(string.Format("javascript: {0}", script));
            }
        }
    }

    public class JSBridge : Java.Lang.Object
    {
        readonly WeakReference<HybridWebViewRenderer> hybridWebViewRenderer;

        public JSBridge(HybridWebViewRenderer hybridRenderer)
        {
            hybridWebViewRenderer = new WeakReference<HybridWebViewRenderer>(hybridRenderer);
        }

        [JavascriptInterface]
        [Export("invokeAction")]
        public void InvokeAction(string data)
        {
            HybridWebViewRenderer hybridRenderer;

            if (hybridWebViewRenderer != null && hybridWebViewRenderer.TryGetTarget(out hybridRenderer))
            {
                hybridRenderer.Element.InvokeAction(data);
            }
        }
    }
}

HybridWebViewRenderer.cs (in .İOS):

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Foundation;
using UIKit;
using System.IO;
using Xamarin.Forms;
using App101;
using App101.iOS;
using Xamarin.Forms.Platform.iOS;
using WebKit;

[assembly: ExportRenderer(typeof(HybridWebView), typeof(HybridWebViewRenderer))]
namespace App101.iOS
{
    public class HybridWebViewRenderer : ViewRenderer<HybridWebView, WKWebView>, IWKScriptMessageHandler
    {
        const string JavaScriptFunction = "function invokeCSharpAction(data){window.webkit.messageHandlers.invokeAction.postMessage(data);}";
        WKUserContentController userController;

        protected override void OnElementChanged(ElementChangedEventArgs<HybridWebView> e)
        {
            base.OnElementChanged(e);

            if (Control == null)
            {
                userController = new WKUserContentController();
                var script = new WKUserScript(new NSString(JavaScriptFunction), WKUserScriptInjectionTime.AtDocumentEnd, false);
                userController.AddUserScript(script);
                userController.AddScriptMessageHandler(this, "invokeAction");

                var config = new WKWebViewConfiguration { UserContentController = userController };
                var webView = new WKWebView(Frame, config);
                SetNativeControl(webView);
            }
            if (e.OldElement != null)
            {
                userController.RemoveAllUserScripts();
                userController.RemoveScriptMessageHandler("invokeAction");
                var hybridWebView = e.OldElement as HybridWebView;
                hybridWebView.Cleanup();
            }
            if (e.NewElement != null)
            {
                string fileName = Path.Combine(NSBundle.MainBundle.BundlePath, string.Format("Content/{0}", Element.Uri));
                Control.LoadRequest(new NSUrlRequest(new NSUrl(fileName, false)));
            }
        }

        public void DidReceiveScriptMessage(WKUserContentController userContentController, WKScriptMessage message)
        {
            Element.InvokeAction(message.Body.ToString());
        }
    }
}

HybridWebView.cs (in PCL):

using System;
using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;

namespace App101
{
    public class HybridWebView : View
    {
        Action<string> action;
        public static readonly BindableProperty UriProperty = BindableProperty.Create(
          propertyName: "Uri",
          returnType: typeof(string),
          declaringType: typeof(HybridWebView),
          defaultValue: default(string));

        public string Uri
        {
            get { return (string)GetValue(UriProperty); }
            set { SetValue(UriProperty, value); }
        }

        public void RegisterAction(Action<string> callback)
        {
            action = callback;
        }

        public void Cleanup()
        {
            action = null;
        }

        public void InvokeAction(string data)
        {
            if (action == null || data == null)
            {
                return;
            }
            action.Invoke(data);
        }
    }
}

What to do for working HybridWebView callback function after redirect?

Cell Accessory does not trigger event attached to the ViewCell GestureRecognizer.

$
0
0

I have a TableView where I am displaying ViewCell items using a Renderer to set the cell.Accessory to a UIKit.UITableViewCellAccessory.DisclosureIndicator.

I add TapGestureRecognizer to the ViewCell to respond to User Click/Selection.

It works great.

The only problem is that the Accessory Button does not trigger the TapGestureRecognizer. If you click on the Left Side of the ViewCell, everything works, if you click on the cell.Accessory the event is not triggered.

My code is based on a solution I found on GitHub.

I have attached a screenshot. Clicking anywhere in the circled area is ignored. It changes appearance the same way regardless of where I click to show it is being clicked, but no event.

Does anyone have any input?


Free open source MRZ reader in Xamarin.Forms for both ios and Android

$
0
0

I have tried Xamarin.tesseract but it's not working, taking too much time and also giving wrong result. Please tell me any free library for reading MRZ or reading all text from the image.

Resource dictionary type not found in namespace xmlns when debugging using iPhone

$
0
0

Hi,All
My Xamarin.iOS project works on android and iPhone simulator, but when i tested it on the real iPhone, i get this error:
Xamarin.Forms.Xaml.XamlParseException: Position 11:8. Type converters:OnlineOfflineToColorConverter not found in xmlns clr-namespace:EvvMobile.Converters;assembly=EvvMobile at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, Xamarin.Forms.Xaml.INode parentNode) [0x00040] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\CreateValuesVisitor.cs:58 at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x000b1] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\XamlNode.cs:175 at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00089] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\XamlNode.cs:172 at Xamarin.Forms.Xaml.RootNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00054] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\XamlNode.cs:223 at Xamarin.Forms.Xaml.XamlLoader.Visit (Xamarin.Forms.Xaml.RootNode rootnode, Xamarin.Forms.Xaml.HydratationContext visitorContext) [0x00053] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\XamlLoader.cs:122 at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.String xaml) [0x00046] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\XamlLoader.cs:76 at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.Type callingType) [0x0002f] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\XamlLoader.cs:56 at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[TXaml] (TXaml view, System.Type callingType) [0x00000] in <e53fc7074dab4ad8bba89c7f3e14cbfc>:0 at EvvMobile.App.InitializeComponent () [0x00001] in /Users/fei/Desktop/workspace/Dev/EvvMobile/EvvMobile/obj/Debug/EvvMobile.App.xaml.g.cs:19 at EvvMobile.App..ctor () [0x00008] in /Users/fei/Desktop/workspace/Dev/EvvMobile/EvvMobile/App.xaml.cs:35 at EvvMobile.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x000b3] in /Users/fei/Desktop/workspace/Dev/EvvMobile/EvvMobile.iOS/AppDelegate.cs:45 at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr) at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/5481/12e80e01/source/xamarin-macios/src/UIKit/UIApplication.cs:79 at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/5481/12e80e01/source/xamarin-macios/src/UIKit/UIApplication.cs:63 at EvvMobile.iOS.Application.Main (System.String[] args) [0x00001] in /Users/fei/Desktop/workspace/Dev/EvvMobile/EvvMobile.iOS/Main.cs:17
How can i fas this ?
this is my code:

Could you help me please?

cell.Accessory button tap on iOS in Xamarin.Forms

$
0
0

I posted this question a few days ago but it did not show up on the forum so I am posting again.

I am using Xamarin Forms for an iOS application

On a few of my screens I am using a TableView with several ViewCells added to display data the user can edit
* The ViewCells are configured to have a DisclosureIndicator in the cell.Accessory button
* The ViewCells also have a TapGestureRecognizer added so I can respond to user selection / user click

When the user presses on the LEFT side of my ViewCell, the TapGestureRecognizer fires, everything is great.

The problem is that when the user presses directly on the cell.Accessory that displays the DisclosureIndicator, my TapGestureRecognizer event is not fired.

The ViewCell does appear as if it is selected / unselected, just like a user click.

Is there any way to have the Accessory click event raised so my TapGestureRecognizer is executed?

The attached photo is a screen shot of the ContentPage.

This has been asked on the forum and on SO, but I did not find any solutions...

CrossGeoLocator plugin hanging

$
0
0

I have this code:

        var timeout = TimeSpan.FromSeconds(1);
         var locator = CrossGeolocator.Current;
         locator.DesiredAccuracy = 100.0;
         if (!CrossGeolocator.IsSupported || !locator.IsGeolocationAvailable || !locator.IsGeolocationEnabled )
         {
            return false;
         }
         var position = await locator.GetPositionAsync(timeout, null, true);
         double speedInMetersPerSecond =  position.Speed;

It consistently hangs on the next-to-last line. Are others experiencing this?

Thanks!

Theme Switch Light and Dark problem

$
0
0

I updated to XAMARIN.FORMS and XAMARIN.FORMS.PAGES V2.3.5.233-pre1 (Also tried V 2.3.4.231) and my dynamic theme changes quit working on current screen. Previously it would change the screen I'm on when I change it and any open screen. Now it seems to require me to close any open screen and reopen it. I'm not sure how to refresh the screens, as that's really not a desired option.

Here is how I change the themes. Any advice would be helpful. If I go back to previous version, it works fine, but then I lose new features I needed.

I'm just using the dark and light themes given I have a simple picker to select them.

    <StackLayout Orientation="Horizontal" >
    <Label Text="Theme"  HorizontalOptions="Start" VerticalOptions="Center" />
    <Picker SelectedIndex="{Binding Theme,Mode=TwoWay}" HorizontalOptions="EndAndExpand" VerticalOptions="Center">
        <Picker.Items>
            <x:String>Light</x:String>
            <x:String>Dark</x:String>
        </Picker.Items>
    </Picker>
    </StackLayout>

I change it with the following by binding picker to Theme below:

  public int Theme
    {
        get { return _theme; }
        set
        {
            _theme = value;
            App.SetTheme = (MySettings.Theme)value;
        }
    }

In App:

            public static MySettings.Theme SetTheme {
                set
                {
                    if (value == MySettings.Theme.Light)
                    {
                        App.Current.Resources = new ResourceDictionaryLight();
                        MySettings.UserPrefTheme = MySettings.Theme.Light;

                    }
                    else if (value == MySettings.Theme.Dark)
                    {
                        App.Current.Resources = new ResourceDictionaryDark();
                        MySettings.UserPrefTheme = MySettings.Theme.Dark;
                    }
                }
            }

The ResourceDictionaryLight xaml like this:

    <?xml version="1.0" encoding="utf-8"?>
    <ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 x:Class="ChurchApp.ResourceDictionaryLight"
                 MergedWith="light:LightThemeResources"
                 xmlns:light="clr-namespace:Xamarin.Forms.Themes;assembly=Xamarin.Forms.Theme.Light">
    </ResourceDictionary>

Feels like a bug (either in old or new) since it changed how it worked without me changing any code, but of course I could be doing something wrong that was forgiven in older version.

Android build Error (APT0000) - new environment/android sdk

$
0
0

Hi,

I have a project (Xamarin Forms) that build perfectly on my windows PC with visual studio 2017.

I configurated new environment on my MAC, and when I try to build, show this errors:

Resources/values/styles.xml(2): error APT0000:  Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
Resources/values/styles.xml(3): error APT0000:  Error: No resource found that matches the given name: attr 'colorAccent'.
Resources/values/styles.xml(2): error APT0000:  Error: No resource found that matches the given name: attr 'colorPrimary'.
Resources/values/styles.xml(2): error APT0000:  Error: No resource found that matches the given name: attr 'colorPrimaryDark'.
Resources/values/styles.xml(2): error APT0000:  Error: No resource found that matches the given name: attr 'windowActionBar'.
Resources/values/styles.xml(4): error APT0000:  Error: No resource found that matches the given name: attr 'windowActionModeOverlay'.
Resources/values/styles.xml(2): error APT0000:  Error: No resource found that matches the given name: attr 'windowNoTitle'.
Resources/values/styles.xml(4): error APT0000:  Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'.
Resources/values/styles.xml(4): error APT0000:  Error: No resource found that matches the given name: attr 'colorAccent'.

IMPORTANT:

  • All computers I using VS2017 with last version of Xamarin and all nuget libraries are up to date.
  • On windows (old environment) I can build and run without problem.
  • iOS Project, build without problem.
  • I tryed to created a new windows environment on VM and have the same error.
  • I tryed to clean project, clean all libraries, but not work.
  • I tryed to create a new Xamarin Forms Project (Hello Word) on MAC and this build.

I think that can be a version of Android SDK, on my Windows (PC that build correct) I have a old version of Android SDK that have a SDK Manager from Android ADK, not is the new version with command line (new version).

MAC environment:

Operating System
Mac OS X 10.13.0

Visual Studio Community 2017 for Mac
Version 7.1.5 (build 2)

Xamarin.Android
Version: 7.4.5.1 (Visual Studio Community)
Android SDK: /Users/wf/AndroidSDK
Supported Android versions:
6.0 (API level 23)
7.1 (API level 25)
SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.5
SDK Build Tools Version: 25.0.3

Windows environment:

Windows 10
Visual Studio 2017
Xamarin Android 4.7.9.45

Somebody can help me?

Tks.

what is the Benefit of Azure Social Authentication?

$
0
0

I dont really understand the benefit of Azure Social Authentication. here there is a great documentation from @AdrianHall . He perfectly described everything but I am confused even more.
I have implemented Aws Cognito in one of my app and it is quite straightforward.
- I make http get request using web view to facebook

  • user logs in. I fetch the token and user information
  • I pass this token to AWS cognito.
  • Cognito stores it for me and everytime I come back to app, I ask Cognito "hey cognito is my token still alive". if yes continue, no ask for authentication again.

But according to Azure documentation,

  • I have to use DI and go native level even for a simple web view request.
  • I have to store token in the app using xamarin.auth
  • i have to verify expiry date using some JWT calculation myself.

So question is what is the purpose of Azure Social auth and why do I have to use it? is it only for backend api for offline snyc?


How to add images to ACR.UserDialogs ActionSheet in UWP?

$
0
0

I am using the ACR.UserDialogs NuGet package to create cross platform ActionSheets with images. The images passed to the ActionSheetConfig object are expected to be Splat.IBitmaps which I create from local files with this line:

img = Splat.BitmapLoader.Current.LoadFromResource(resourcename, 50f, 50f).Result;

It works for iOS and Android, but hangs in UWP.

Does anyone know how to add images to a ACR.UserDialogs ActionSheet in UWP?

Stop listview from scrolling when re binding the item

$
0
0

I have listview loaded with items. When update the model and try to re bind the item source the listview scrolling to different position.
Please suggest a way to stop listview from scrolling when re binding the data or scroll the previous position.
I am using observable collection for the list.

Thanks.

"logout" from MasterDetailPage

$
0
0

Good morning,

I'm following the pattern from the master detail page tutorial, implementing the whole "hamburger menu", etc.

My question: In the navigation page, I need to add a "logout". The only way I can think of doing it is by adding another view called "logout" and by setting "App.Content.MainPage" to my LoginPag(). Please see my code:

    protected override void OnAppearing()
    {
        App.DAUtil.DeleteUser();
        App.IsUserLoggedIn = false;

        App.Current.MainPage = new NavigationPage(new LoginPage());
    }

Is this the correct methodology to integrate logout / login w/in a master detail page?

Thanks

Xamarin forms - in IOS checkbox is not showing but android working fine

$
0
0

i am using XLabs.Froms version 2.3.0 pre02.

Solution for Create file PDF on Xamarin Form???

$
0
0

I'm stuck on this. Anyone have solutions. I just need to add a MicroChart and a ListView into it.

Viewing all 75885 articles
Browse latest View live


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