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

ToolbarItem with Order="Secondary" not functional in iOS?

$
0
0

It is not a problem that they appear as Buttons (???) inbetween the Title and the ListView in iOS. But when I tap them the Clicked events are not fired.

Is that normal? How do I make them functional in iOS?


Which version of NDK should we use? not latest?

$
0
0

I was told that we should always use the version NDK according to below
https://github.com/xamarin/xamarin-android/blob/master/build-tools/android-toolchain/android-toolchain.projitems

as it seems 14b version is used, we can use highest 14b? which is from march 2017, pretty old. why is it? I tried used 18b today latest version and my project works fine in debug mode and compiles also fine in release mode. Problem occurs when i want to install the app in release more or try to create a package. I get this exception

Error       XA5101: C compiler for target Arm was not found. Tried paths: 
"C:\Android\android-ndk-r18b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-gcc.exe; 
C:\Android\android-ndk-r18b\prebuilt\windows-x86_64\bin\gcc"

So, can someone confirm from xamarin team if we can rely on android-toolchain.projitems file or we can simply use latest NDK, maybe my exception is something else?

how to raise a local notification remotely?

$
0
0

I have programmed for each platform local notifications and i am wondering if it will be possible to raise a local notification remotely? not sure what tool fits best for it? something probably like SignalR. It is probably similar concept as what OneSignal or Firebase is doing. what is the best way to achieve this?

Stack-smashing Protection (SSP) in Xamarin forms?

$
0
0

I'm seeing the security of my application and I have to enable the Stack Smashing Protection (SSP) in my app. it's possible for android project (Xamarin Forms). There is no documentation related to the subject. Thanks for your time.

Xamarin Forms Firebase Push Notification Plugin

$
0
0

For those who use this plugin. I do not generate a registration token for iOS, although everything works for Android. Is there a possible problem with the plugin?

Automatic Reference Counting not enabled in Xamarin forms

$
0
0

Hello. I'm seeing the security of my application and I have to enable the ARC (Automatic Reference Counting) in xamarin forms. t's possible for ios project (Xamarin Forms)? Thanks for your time.

How to set binding context with Source={x:reference view } in ResourceDictionary

Forms Hybrid

$
0
0

Hi, I have a current solution where I developed and app for iOS and Android in their specific Xamain.Android and Xamarin.iOS areas a way back before Forms was mature enough to use.

I need to add some new screens to both so it is possible to develop them using Forms and meld them into both projects so I only have to create the one set?
So can I mix Xamarin.Android/.iOS with Forms in one project?

Thanks


Foundation.MonoTouchException has been thrown in xamarin.forms

$
0
0

Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Application windows are expected to have a root view controller at the end of application launch..

I am using Prism Structure with xamarin.forms.My app is runing on android properly.when i run my app on ios then exception is occur..
i cleaned the whole project and after build all project but still error is coming..if any one has any solution then please suggest me..

I want to show a video player in eachcell in Listview in XAMARIN forms. Please suggest me.

$
0
0

Please let me know. Guys, I need some sort of suggestion.

My app command bar changed its color for no good reason

$
0
0

A strange thing happened to my application. The main window command bar (the one with minimize and maximize buttons) from common gray became black. The buttons stayed gray. I don't think I did anything to cause this.
Could you please give me any idea what did this and how to change this back?

Issue creating APK in VS 2017

$
0
0

Hi,
My Xamarin.Forms app works in debug mode, but if I build in release mode and I try to create an APK from VS 2017, it doesn't work.
The build process succeeded but the APK is not yet created.
My Xamarin.Forms version is 3.4.0.1008975 and my VS is up to date.

Target Android version is 9.0.

Here above the application logs:

Xamarin.VisualStudio.Publishing.ArchiveManager|Error|0|System.NotSupportedException: This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread.
at System.Windows.Data.CollectionView.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
at System.Collections.ObjectModel.ObservableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at Microsoft.VisualStudio.PlatformUI.HierarchyItem.HierarchyItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection1.InsertItem(Int32 index, T item)
at System.Collections.ObjectModel.Collection1.Add(T item) at Microsoft.VisualStudio.PlatformUI.HierarchyItem.AppendChildren(IVsHierarchy hierarchy, UInt32 itemID, List1 appendedChildren)
at Microsoft.VisualStudio.PlatformUI.HierarchyItem.FillChildren()
at Microsoft.VisualStudio.PlatformUI.HierarchyItem.get_InternalChildren()
at Microsoft.VisualStudio.PlatformUI.HierarchyItem.get_Children()
at Clide.SolutionExplorerNode.get_Nodes() in E:\A_work\184\s\src\Clide\Solution\SolutionExplorerNode.cs:line 166
at Clide.ITreeNodeExtensions.<>c.b__1_0(ISolutionExplorerNode x) in E:\A_work\184\s\src\Clide.Interfaces\Extensions\ITreeNodeExtensions.cs:line 33
at Traverser.d__21.MoveNext() in E:\A\_work\184\s\src\Clide.Interfaces\Extensions\Traverser.cs:line 70 at System.Linq.Enumerable.<OfTypeIterator>d__951.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Clide.AndroidClideExtensions.GetAndroidResources(IProjectNode projectNode) in E:\A_work\293\s\src\Core\VisualStudio.Android\ProjectSystem\Extensions.cs:line 128
at Xamarin.VisualStudio.Android.Publishing.AndroidArchiveToolsService.CreateParameters(IProjectNode project) in E:\A_work\293\s\src\Core\VisualStudio.Android\Services\Publishing\Archival\AndroidArchiveToolsService.cs:line 186
at Xamarin.VisualStudio.Android.Publishing.AndroidArchiveToolsService.ArchiveAsync(IProjectNode project, IProgressReport progress, CancellationToken cancellationToken) in E:\A_work\293\s\src\Core\VisualStudio.Android\Services\Publishing\Archival\AndroidArchiveToolsService.cs:line 113
at Xamarin.VisualStudio.Publishing.ArchivableProjectBase.d__8.MoveNext() in E:\A_work\293\s\src\Core\VisualStudio.Publishing\Archival\ArchivableProjectBase.cs:line 30
--- End of stack trace from previous location where exception was thrown ---

Read pixel data of Image in Xamarin Forms

$
0
0

Hi Team,
I am looking to get help on converting Image to 3D byte array, reading its RGB values
This code works fine on my .Net platform, but with Xamarin I have trouble getting Color and Bitmap class working together. Could someone help me get an equivalent code for Xamarin platform ?

    byte[] imageData = new WebClient().DownloadData(imurl);
                MemoryStream imgStream = new MemoryStream(imageData);
                curr_img = Image.FromStream(imgStream);
                Bitmap bmp = new Bitmap(curr_img);

                int wSize = curr_img.Width;
                int hSize = curr_img.Height;

                image_inlist = new List<List<List<int>>>(); 
                for(int i=0; i < hSize; i++)
                {
                    List<List<int>> eachrow = new List<List<int>>();
                    for(int j=0; j<wSize; j++)
                    {
                        Color clr = bmp.GetPixel(j, i);
                        eachrow.Add(new List<int> {clr.R,clr.G,clr.B});

                    }
                    image_inlist.Add(eachrow);
                }

UWP app breaks when the code execution comes to displayalert line

$
0
0

I am using displayalert in my project and it is working fine on android and ios devices. But for the UWP part it is not working in some pages. When the code execution comes to displayalert line the UWP app breaks and redirecting to App.g.i.cs. Code control comes to the following if block.

#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
        UnhandledException += (sender, e) =>
        {
            if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
        };
#endif

If I mouse over the e showing {Windows.UI.Xaml.UnhandledExceptionEventArgs}

I am using the following code for display alert:

await DisplayAlert("Alert", "A verification code has been sent to your email.", "OK");

If I changed the above lines like below, no issue will come.

Device.BeginInvokeOnMainThread(async () => 
{
    await DisplayAlert("Alert", "A verification code has been sent to your email.", "OK");
});

Is there any solution to this issue without adding Device.BeginInvokeOnMainThread? And what is the reason behind this issue?

Bottom navigation in all the screens

$
0
0

Hi
I have 4 items in bottom navigation ,so i want these Bottom navigation in all the screens.For example even if i click on Hmaburger menu items the bottom navigation should be there..How to do this..please help

Thanks


VS 2017 xamarin sample - Hello, Android Multiscreen: Quickstart.

$
0
0

I am attempting to create the first Xamarin form. Using the sample HELLO, ANDROID MULTISSCREEN; QUICKSTART. I am at ADDING A LIST. Instruction Next, create an empty list that can be filled with phone numbers. The MainActivity class will look like this.
[Activity(Label = "Phoneword", MainLauncher = true)]
public class MainActivity : Activity
{
static readonly List phoneNumbers = new List();
...// OnCreate, etc.
}

Their is a copy sign but, there is not instruction as where to copy and place this code. All other code have instruction as where to paste the code. Please help.

How to use Google Drive in Xamarin Forms?

$
0
0

Hi!
1. As the title, How to use Google Drive in Xamarin Forms?
I have found this link but it use CustomRenderer.

  1. How many way to use Google Drive in Xamarin Formns?
  2. How to use it directly in PCL (NET Standard)?

Thank you!

x:Array of OnPlatform

$
0
0

Is it would works?

      <x:Array Type="{x:Type x:String}">
       <OnPlatform x:TypeArguments="x:String">
         <On Platform="Android, iOS">My string value for these platforms</On>
        </OnPlatform>
      </x:Array>

because I'm gettting the following error:

{System.InvalidCastException
  at (wrapper managed-to-native) System.Array.SetValueImpl(System.Array,object,int)
  at System.Array.SetValue (System.Object value, System.Int32 index) [0x00057] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
  at System.Array.System.Collections.IList.set_Item (System.Int32 index, System.Object value) [0x00000] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
  at Xamarin.Forms.Xaml.ArrayExtension.ProvideValue (System.IServiceProvider serviceProvider) [0x0003e] in D:\a\1\s\Xamarin.Forms.Xaml\MarkupExtensions\ArrayExtension.cs:30 
  at Xamarin.Forms.Xaml.ArrayExtension.Xamarin.Forms.Xaml.IMarkupExtension.ProvideValue (System.IServiceProvider serviceProvider) [0x00000] in D:\a\1\s\Xamarin.Forms.Xaml\MarkupExtensions\ArrayExtension.cs:37 
  at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, Xamarin.Forms.Xaml.INode parentNode) [0x00341] in D:\a\1\s\Xamarin.Forms.Xaml\CreateValuesVisitor.cs:104 
  at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x000ac] in D:\a\1\s\Xamarin.Forms.Xaml\XamlNode.cs:149 
  at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00044] in D:\a\1\s\Xamarin.Forms.Xaml\XamlNode.cs:143 
  at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00079] in D:\a\1\s\Xamarin.Forms.Xaml\XamlNode.cs:145 
  at Xamarin.Forms.Xaml.RootNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00044] in D:\a\1\s\Xamarin.Forms.Xaml\XamlNode.cs:200 
  at Xamarin.Forms.Xaml.XamlLoader.Visit (Xamarin.Forms.Xaml.RootNode rootnode, Xamarin.Forms.Xaml.HydrationContext visitorContext) [0x00054] in D:\a\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:139 
  at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.String xaml) [0x00058] in D:\a\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:87 
  at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[TXaml] (TXaml view, System.String xaml) 

Is Xamarin compatible with a WCF and NetTcpBinding ?

$
0
0

Hi, I have a Xamarin app consuming a WCF. It works perfectfly with HttpBinding. Is it possible to use a NetTcpBinding also ?

Linking C# to additional Objective C header file.

$
0
0

Hi guys, I have created a UI on Mac OS recently (Not phone Apps), and I am trying to link it to an additional Objective C code.
The source of this approach is really limited as all I found was about phone apps development. Hence I am trying to verify whether my concept is do-able or not. My Approach is as below :

My solution consist of Objective C and C#, which is linked internally when I created a new solution. These are done in the background by developers of these templates, where C# is the main sequence of the whole User Interface operations. Now I have created an Objective C file (externally), with all the functions to be called in its header file. I would love to link my UI (C# and Objective-C) to this Objective C file, the similar way developers used to link C# to Objective C.

This is the only link related to the subject that I am looking for, unfortunately it is mainly about phone Apps development.
https://docs.microsoft.com/en-us/xamarin/ios/platform/binding-objective-c/index

Below are small parts of my code /:

UI code:

MainViewController.designer.cs (Visual Studio for Mac)

using Foundation;
using System.CodeDom.Compiler;

namespace Main
{
    [Register ("MainViewController")]
    partial class MainViewController
    {
        [Outlet]
        AppKit.NSButton btnConnect { get; set; }

        [Action ("btnSubWindow:")]
        partial void BtnPopOut (AppKit.NSButton sender);
    }

    void ReleaseDesignerOutlets ()
        {
            if (btnConnect != null) {
                btnConnect.Dispose ();
                btnConnect = null;
            }
        }
}

MainViewController.m (Xcode)

#import "TestLauncherViewController.h"

@implementation TestLauncherViewController

@synthesize btnConnect = _btnConnect;
- (IBAction)btnSubWindow:(NSButton *)sender {
}

@end

MainViewController.h (Xcode)

#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>


@interface TestLauncherViewController : NSViewController {
    NSButton *_btnConnect;
@property (nonatomic, retain) IBOutlet NSButton *btnConnect;
- (IBAction)btnSubWindow:(NSButton *)sender;

@end

From here, we know that Objective-C has been linked to C#, and ready to be altered from C#.

Below are part of my externally created Objective C file:

Addition.h

@interface Addition : NSObject{
    int     progress;
    Status  state;
}
-(instancetype)initWithIP:(char*)ipaddress andUIdelegate:(id)del;
-(void)startToRun;
-(int)Multiplication;
@end

I am trying to use C# to access this Objective C header file to search for the entry point of any functions that I wish to call.
Please tell me if my concept is doable or not.

If do-doable :
Please provide me some guidance to achieve this approach.
Thank you in advance.

Viewing all 91519 articles
Browse latest View live


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