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

Create a Xamarin library which can be consume by native iOS, Android applications

$
0
0

Hello!

Actually, i want to reuse my Xamarin shared code into different native apps.
So that, if anyone can help me to create xamarin lib which can be consume by native iOS & Android applications then it would be great.

Or else
if any other way to reuse Xamarin shared code into native apps then please do suggest.

Best Regards,
Rahul Bhamare.


Launch storyboard not found Exception thrown when upload ipa file from Application Loader

$
0
0

I Have create an app using Xamarin.Form and Visual studio 2017 . i want to upload ipa file from Application Loader following Exception Thrown. please tell me how do i resolve it.

How to design beautiful UI for E-Commerce App in Xamarin.Forms?

$
0
0

Hi Folks,
How are you doing? I am going to develop an Ecommerce Xamarin.Forms App that I expect to look similar to the one in the picture above. I need your help in designing its UI for Items catalog Page. From the picture, I guess to have a MasterDetailPage , a master page for categories of products and a Detail page for Items of Respective category.

App will fetch data from Sql Azure Database hosted on Microsoft Azure via Asp.Net Web API and I want UI to be automatically updated (New boxes, Item templates or in simple words, Items to be added /shown in the page upon screen refresh) if database has got some new products/items in it. Problem that I have is that I am not sure how to make these products boxes, divide them in 2 columns and two products in each row as shown in the picture.

Kindly guide me on how can I achieve this and which UI controls should I use?
Thanks :smile:

Guidance on making application more responsive on Android devices

$
0
0

Hi,
I have an Xamarin.Forms application and would like to make it more responsive, because when I run it on several Android emulators it looks different depending on resolutions setted on each device. Any suggestions? I mostly use Grid Layout.

Best,
Tomasz Kowalczyk

Remove Multiple FCM Messages- Xamarin Forms - iOS

$
0
0

I have implemented FCM in Xamarin Forms and is working as expected. But I want to remove all the notifications from the notification tray when a new push is received.

I have able to do the same with the Tag key in Android, how to achieve the same on iOS.

Can someone help me with this?

Sharing session between WebView and app

$
0
0

Hi

Is there a way we can share session between WebView and app.

I am logging through WebView using URL, and need to show content page based on success or failure.

Thanks
gsalunkhe

Which event is fired when back button is pressed while keyboard is open in android?

$
0
0

Hi All,

OnBackButtonPressed() is not hitting when pressing back button while keyboard is open.

Need to unfocus the entry when keyboard hides usin back button.

Any help is appreciated.
Thanks

Measuring text length (Android)

$
0
0

I'm attempting to create an expandable Entry that adjusts to the size of the text within it through custom rendering but I can't figure out how to properly measure the text. What I'm currently doing:

protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
    base.OnElementPropertyChanged(sender, e);
    if (e.PropertyName.Equals("Text"))
    {
            //Method 1:
            Android.Text.TextPaint paint = new Android.Text.TextPaint();
                    paint.SetTypeface(Control.Typeface);
            var TextSize = paint.MeasureText(Control.Text) ; //Returns 7 per character

            //Method 2:
            Android.Widget.EditText nativetextfield = (Android.Widget.EditText)Control;
            nativetextfield.Paint.SetTypeface(nativetextfield.Typeface); //This is unnecessary I guess, but I've tried it.
            var TextSize = nativetextfield.Paint.MeasureText(nativetextfield.Text); //Returns 51 per character

            if (TextSize > entry.Width)
            {
                entry.WidthRequest = TextSize;
            }
    }
}

I was sure I had used a third method where each character is measured to 15 but I can't remember what it was. However, the correct measurement of a character seem to be more around 8-12. The placeholder "Tap to type" creates a 101.67 width Entry (meaning avg 9.24 per character), so the round numbers i get from these methods doesn't seem correct. Any advice?


How can I access Navigation from within a ViewCell?

$
0
0

Let's say that I have a custom ViewCell for a ListView, where each cell contains a button. When a user clicks that button I'd like to be able to push a new page onto the navigation stack. The problem is that because I'm not inside the ContentPage, but in a ViewCell, I don't have access to the Navigation property.

The cells themselves are also managed automatically through the ListView, so as far as I know I don't have a way to pass the parent ContentPage through the constructor, right?

Is there a way to access the Navigation features from the ViewCell? Or do I need to somehow restructure my ListView to pass the ContentPage through to each ViewCell?

Showing wrong current location in Xamarin forms Geolocator

$
0
0

Hi everyone, I am using Geolocator plugin for getting current device location but it shows wrong result. Now I am in India but it shows San Francisco. Can you please suggest what wrong I have done. Thank you advance.

code :

var locator = CrossGeoLocator.Current;

locator.DesiredAccuracy = 50;

var position = await locator.GetPositionAsync(1000);

When I verified finally getting coordinates it's belongs to San Francisco.

Could not connect to the debugger after Mac Update

$
0
0

Hello,
After I have update my iOS version on my mac, i can't deploy a debug app on the android emulator now. Do you know a solution ?
ERROR : "Could not connect to the debugger"
Thanks.

Error About XamlC

$
0
0

Hi.. I'm updated to xamarin.forms packages 2.3.4.247 version when I try to build the app it becomes error the result is "The target "XamlC" does not exist in the project."
Can someone help?

.NET Standard + Prism

$
0
0

Do Prism supports .NET Standard already? Or, are there any mvvm frameworks who supports .NET Standard lately?

Download and display images from sharepoint (X.Forms PCL)

$
0
0

Hi there !

I'm currently developping an app based one Sharepoint REST API and Microsoft Graph. My app is composed mainly with a Tabbed Page, and on the first tab I want to display News from sharepoint. To do so I want to get images from the news, but using the url of the images as Image Source returns me "forbidden" error. So, I decided to find a way to download those images. I've been looking for a way for few days now, and found nothing...

Does anyone knows a way to do that, or why do I have a forbidden access error ?

I bring some precisions, I'm using an HttpClient to authenticate to the tenant with REST API :

       client = new HttpClient();
       Uri mUri = new Uri(App.ReturnUri);
       client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
       var data = await DependencyService.Get<IAuthenticator>()
                     .Authenticate(App.LoginAuthority, App.RestResourceUri, App.ClientId, mUri);
       App.AuthenticationResult = data;
       client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", App.AuthenticationResult.AccessToken);

From that, I hope someone knows if there is a way to download images, or to access to url in order to use them as Source. I succeeded in retrieving URLs but not displaying images, knowing that I can retrieve any other data from sharepoint

Thanks for any help,

Getting "ResolveLibraryProjectImports" task failed unexpectedly in release mode

$
0
0

In debug mode its working fine but in release mode i am getting this error.

Severity Code Description Project File Line Suppression State
Error The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
at System.IO.PathHelper.GetFullPathName()
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.IO.File.Open(String path, FileMode mode)
at Xamarin.Tools.Zip.ZipEntry.DoExtract(IntPtr zipFile, String destinationPath, FileMode outputFileMode, EntryExtractEventArgs args)
at Xamarin.Tools.Zip.ZipEntry.Extract(String destinationDir, String destinationFileName, FileMode outputFileMode)
at Xamarin.Android.Tools.Files.ExtractAll(ZipArchive zip, String destination, Action2 progressCallback) at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res, ICollection1 jars, ICollection1 resolvedResourceDirectories, ICollection1 resolvedAssetDirectories, ICollection`1 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() Smart_Hire.Android

can anyone please help me out with the issue.

Thanks in advance


Portrait/Landscape and StatusBar iOS

$
0
0

Hello all ,

I want to change orientation of my screen at some moment so on android i have this :

((MainActivity)activity).RequestedOrientation = ScreenOrientation.Landscape; //or ((MainActivity)activity).RequestedOrientation = ScreenOrientation.Portrait;

(1) How can i do that on iOS? Any idea?

(2) I want to disable status bar on top on iOS . It's possible? how can i do that?

Thanks in advance.

Acr.Barcodes

$
0
0

I've installed last Acr.Barcodes package from nuget, but when I try to use it the camera does not turn on (I see only the red line).
If I download source from github, it works fine.
Someone has the same problem?
Alessandro

MVVM Light - How to use the selectedIndexChanged event in viewModel

$
0
0

Hi !
I try to use the selectedIndexChanged event in my viewModel but when i write this :

I have the following error :
"No Property of name SelectedIndexChanged found"

Anyone can help me ?
Thanks !

App not deployed Problem with debugging also without debugging

$
0
0

App not being deployed unable to find the reason
Please help ASAP

  Assembly System.Diagnostics.Tools[0xad994f00] added to domain RootDomain, ref_count=1
    07-22 19:52:16.322 D/Mono    ( 3003): AOT: image 'System.Diagnostics.Tools.dll.so' not found: dlopen failed: library "/data/app/App9.Android-1/lib/x86/libaot-System.Diagnostics.Tools.dll.so" not found
    07-22 19:52:16.322 D/Mono    ( 3003): AOT: image '/usr/local/lib/mono/aot-cache/x86/System.Diagnostics.Tools.dll.so' not found: dlopen failed: library "/data/app/App9.Android-1/lib/x86/libaot-System.Diagnostics.Tools.dll.so" not found
    07-22 19:52:16.322 D/Mono    ( 3003): Config attempting to parse: 'System.Diagnostics.Tools.dll.config'.
    07-22 19:52:16.322 D/Mono    ( 3003): Config attempting to parse: '/usr/local/etc/mono/assemblies/System.Diagnostics.Tools/System.Diagnostics.Tools.config'.
    07-22 19:52:16.322 D/Mono    ( 3003): Assembly Ref addref App9[0xad994d80] -> System.Diagnostics.Tools[0xad994f00]: 2
    07-22 19:52:16.323 D/Mono    ( 3003): Assembly Ref addref System.Diagnostics.Tools[0xad994f00] -> System[0xaed54720]: 9
    07-22 19:52:41.692 D/Mono    ( 3003): [0x9cf3f930] worker finishing
    07-22 19:53:05.773 D/Mono    ( 3003): [0x9d0fd930] worker finishing
    07-22 19:53:13.194 D/Mono    ( 3003): [0x9d1fe930] worker finishing

xaml parse failed with exception

$
0
0

i tried to load resource programmatically.
But the XAML load failed with parse exception - Xamarin.Forms.Platform.UWP.FormsPresenter

Viewing all 89864 articles
Browse latest View live