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

Native Forms UWP CreateFrameworkElement() can only be used in a frame?

$
0
0

I'm doing some experimenting with Native Forms on UWP. It looks like from the samples, that the FrameworkElement that you get from ContentPage.CreateFrameworkElement() can only be placed inside a Frame. And furthermore, it looks like a Frame can only exist at the very root of the application. So this means that Xamarin Forms can only be "embedded" as only a top level (page level) form for the application, rather than in any arbitrary panel? I tried adding the FrameworkElement to a UWP StackPanel and it doesn't render. Is there a way to place the FrameworkElement from a ContentPage anywhere in your app? If not, it seems extremely limiting and almost useless. Am I missing something?


Alert Explossion in Xamarin Forms.

$
0
0

Hi,

I'm developing an application with Xamarin Forms 2.3.4.247 and Prism 6.3.0.

I'm currently having an issue that I've been unable to solve or to identify what's causing it.

When my application being executed on release mode, after a few hours of usage the screen gets filled with all the Alerts displayed during the session lifetime. It just explodes, showing a bunch of cascading alerts and then the application stops working.

The code I'm using to show alerts varies in these 4 ways:

await _pageDialogService.DisplayAlertAsync(Resources.Localization.Main.Main_Success_Label, successMessage, Resources.Localization.Main.Main_OK_Label);
await _pageDialogService.DisplayAlertAsync(errorTitle, errorMessage, cancelButton);
await _pageDialogService.DisplayActionSheetAsync(title, cancelButton, destroyButton, otherButtons);
await _pageDialogService.DisplayAlertAsync(errorTitle, errorMessage, cancelButton);

I'm using IPageDialogService from Prism.Services.

When I use it these lines of code (separately) in different part of my application the alert displays without problem. But after a while all of them get displayed again.

Does anybody know what could be the cause of this? Or how to solve it?

xamarin forms map is not showing

$
0
0

xamarin forms map was not showing

i already checked access permission.

how can i solve this problem?

How to crop a zone of Camera Preview?

$
0
0

I have success show a Camera Preview (I use CustomRenderer a View) and draw a Rectangle at the center of Camera Preview (I use SkiaSharp to draw directly in xaml.cs file).
Now I only want to get Image (take a shot or video) inside that Rectangle.
How to do that!
Thank you

How to select values for entry (text box) from different forms?

$
0
0

Hello Friends,

I have a form with three Picker controls for user to select values. All these Pickers are bound with data source. Clicking on them pops up all the items and user can select the items. This is working correctly.

However what the issue here is there are lots of items in the data source so I need Search functionality for users to look for a item and select it. Can you please help me how can I achieve this?

I have tried opening a new form and selecting values from there but I don't know how to preserve the values of other picker controls when coming back from new forms.

Please help me how can I achieve this.

Thank You

Loading a PDF file

$
0
0

Hi Everyone,

I am getting a byte array from server for the pdf file and I want to load it in app.
What are the options available for this?

Thanks
Kaushalya

How to implement lockscreen in Xamarin forms application?

$
0
0

I'm trying to get access to the device lockscreen in a xamarin forms pcl project. I have heard about third-party components such as Lockscreen and Passcode but i dont know how to go about it since this is a xamarin forms app not xamarin.android. How would i implement let's say Lockscreen in the android project of my xamarin forms application?

distance between two coordinates using geocoder

$
0
0

I get coordinates for to address using geocoder and i want to calculate the distance between the two address in kilometers


Failed to get Java SDK version as it doesn't appear to contains a valid version number.

$
0
0

I can't build for android because of the warning (and almost same related error) as given in the title. It happened after I downloaded JDK for unity, before downloading JDK (for Unity) everything was fine.

iOS barTintColor is always lighter than the color that is defined

$
0
0

I have this color "#31608c",
On forms I set the action bar with this color and seems fine,

but when i manually decompose it to RGB (49,96,140) and set the BarTintColor on iOS platform
it always seems lighter than the color from the action bar.

any ideas? Im not even converting by code anymore, im just typing the colors directly into the parameter.

            // 31608c   -> (49,96,140)
            UITabBar.Appearance.BackgroundColor = UIColor.FromRGB(49, 96, 140);
            UITabBar.Appearance.TintColor = UIColor.FromRGB(49, 96, 140);

            // UITabBar.Appearance.BarTintColor = UIColor.FromRGB(r, g, b);
            UITabBar.Appearance.BarTintColor =  UIColor.FromRGB(49-10, 96-10, 140-10);

            Debug.WriteLine("Tint->" + r + " " + g + " " + b);
            UITabBar.Appearance.SelectedImageTintColor = UIColor.White;

Xamarin Picker get value

$
0
0

A class
public class A
{
public int id{get;set;}
public string name {get;set;}
}

XAML

   <Picker x:name="picker1" ItemsDisplayBinding = "{Binding name}" ItemsSource="{Binding SomeClass}" SelectedIndexedChanged="fun"/>

    <Picker x:name="picker2" ItemsDisplayBinding = "{Binding some_val}" ItemsSource="{Binding A}"

XAML.cs
fun()
{
var value = picker1.Items[picker1.SelectedIndex];
}

In Picker 1 if I set ItemsDisplayBinding = {Binding name}, then the value in the picker contains "NAMES"
In Picker 1 if I set ItemsDisplayBinding = {Binding id}, then the value in the picker contains "ID"

The issue is I want to DISPLAY "names" in picker1 but want the value of the corrosponding "ID". How is this possible?

Project structure for multiple similar projects

$
0
0

I have a few apps that are almost similar, only with different branding. What's the best way to structure the projects to share the same code?

how many pins in xamarin map?

$
0
0

how many pins in xamarin map?

i make 20 pins in xamarin map, but in the map show 20 less pins.

i wanna make more pins, how can i do?

ResolveLibraryProjectImports" task failed unexpectedly Error.

$
0
0

Hello,
I am creating xamarin.forms application to work on android, ios and windows platform. my application is working well when i run the xamarin.UWP project but if I try to run the xamarin.android project its giving me the error as

Severity Code Description Project File Line Suppression State
Error The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'Windows.Foundation.UniversalApiContract.winmd, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Windows.Foundation.UniversalApiContract.winmd.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() GSTKhata.Client.Android

I tried cleaning and rebuilding the solution lot many times and even my project path is small but it doesn't helped. Can anyone help me to solve this?

also, can anyone tell me how can I run my xamarin.forms application on all three platforms(ios, android, windows)?

Overlapping Layouts, input transparency

$
0
0

I have the following issue. I have a screen which is filled with a mapview on the bottom layer. I need to overlay several buttons on the map. I've only managed to do the overlapping by using absolutelayout, like this:

absolutelayout
- mapview with absolutelayout bounds 0,0,1,1
- stacklayout with absolutelayout bounds 0,0,1,1, containing the buttons I need, showing up over the mapview

It shows up exactly as I want it, however, the top stacklayout swallows the input events. Its buttons react normally, but the touch events never arrive down to the mapview, so I can't interact with it (no scrolling, zooming, etc).

I've tried setting InputTransparent="true" on the stacklayout, in this case the mapview works as intended, but obviously the buttons don't. I tried setting InputTransparent="false" explicitly on the buttons themselves, hoping this could override the parent stacklayout's "true" setting, but it doesn't help.

Surely there must be a way to sort this out?


Connecting Oracle DB and Xamarin Forms

$
0
0

I have a project to connect my Application in Xamarin.Forms in cross platform and Oracle DB but i cant find any solution to connect it.
Please help

thanks

Side drawer menu in Xamarin.Forms for iOS and Android

$
0
0

Are there any examples or starter apps for Xamarin.Forms that have a side drawer menu (like in the Evolve 2014 app) for both iOS and Android?

Using binding and localisation

$
0
0

I try to create something like that:

<Label Text="{Binding oResult.hi, StringFormat='Hallo: {0}'}" />

And it works fine! But i wish that the String "Hallo" should get out from the resx file.

Like this:

<Entry Placeholder="{i18n:TranslateExtension Text=password}" IsPassword="true" />

Also i will do a combination of both.

Thank you!

Custom RelativeLayout renderer

$
0
0

It's there a way to create a custom renderer for the layouts?

I just want to add some borders, and stuff like that on iOS.

Thanks!

how to check whether your xamarin forms application is connected to internet or not .

$
0
0

how to check whether your xamarin forms application is connected to internet or not and throw exception if your application is not connected to internet.

Viewing all 58056 articles
Browse latest View live


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