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

How can I connect to our internal IIS server from VS debug session?

$
0
0

I've written and deployed an asp.net core 3 web api REST service to our server on our network, which is hosted in IIS, and sending HTTP requests to the service works using Postman. Now I am writing a Xamarin app which needs to connect to this service. All this will be from within our network, so the server is referenced by name and its IP address is always an internal one. When debugging the app in Visual Studio, I cannot reach the server.

The Xamarin project is UWP and Android, and so far I've only been testing on UWP. I can get a response from google.com, but not from our internal server either by name or internal IP address.


ListView inside CarouselView scroll vertical is almost impossible.

$
0
0

I have a collection of listviews inside a horizontal CarouselView. When im trying to scroll vertically through the listview in focus, if make any tiny movement horizontally, the carousels horizontal scrolling "takes over" and makes scrolling vertically almost impossible. Anyway i can "prioritize" the listviews scrolling?

Hope it makes sense :)

How to get audio file locations?

$
0
0

I am trying to get locations of audio files in Xamarin.Forms. I am currently using resources to play audio file, I put there myself, but want to search the phone for these files and save in a List with its locations?

Is it possible to use 2 resx file at the same time?

$
0
0

I need to have, in a Page, two labels

LableA
LableB (translaction of A)

For example

Autore
Author

is it possible with resx files to manage this situation?
Should I have in the resx files two strings (for example, in AppResource_it I should have "strAutore" = "Autore" and "strAutoreTranslation" = "Author") or can I have in

AppResource_it "strAutore" = "Autore"
AppResource_en "strAutore" = "Author"

and manage these in my Page?

Other solutions?

Thanks

How can my app keep connected to a network without internet connection?

$
0
0

Hello,

My app must connect to a network (which don't have access to internet) programatically, how ever the smartphone go back the last network automatically. How can I avoid that?

It seems that priority is not working.

Edit: I'm using xamarin.forms, but i'm having this issue just with android.
Best Regards,

Xamarin forms: Image entry is not working as expected in android.

$
0
0

I follow this blog for adding an image inside of an entry. It was working fine in android and IOS initially.

But when I changed the android target version and target framework to 9.0 this feature start breaking. Please see the following screenshot.

enter image description here

The image inside entry is zoomed in and not showing as expected. I have updated all the android SDK but no change in the output. Should I do anything else for solving this issue in android?

If I downgrade the version from 9.0(pie) to 8.1(oreo), the UI will work as expected. Why in 9.0 it is not working?

Simpe WebApi Call

$
0
0

Hi, I'm new in Xamarin.
I created new application Xamarin.Form just to try a simple call Restfull using public json placeholder, but not works. So the result is always null. here the code:

HttpClient client = new HttpClient();
HttpResponseMessage Resp = await client.GetAsync("jsonplaceholder.typicode.com/posts/1");

Resp is null.

Please note that I removed the https:// because I am new user and the forum doesn't allow me to write full http address. But in the code it is correct.

thanks for helping me!

Help With Crash Error?

$
0
0

Okay guys, I'm baffled - and I can't figure out what's going on with the app I'm writing.

At launch the app opens as expected, pages load and close with no issues, but I have one page that can only be opened once, and if you navigate away and try to go back it crashes with the error below.

Background:
The app is built with Xamarin.Forms Shell, and all navigation requests use: await Current.Shell.GoToAsync("pagename", true);

I'm thinking it has something to do with either the Entry or DatePicker based on what I think the StackTrace is showing me, but I'm not sure what's going on because it only happens on the 2nd time I try to navigate to the page - even if I navigate to a dozen other pages in between the 1st and 2nd time to this page. Any thoughts on how I can debug this any further without trying to rebuild the entire page?

ERROR:
System.ArgumentNullException has been thrown
Value cannot be null.
Parameter name: value

STACK TRACE:
at MaterialComponents.TextInputControllerBase.set_InlinePlaceholderColor (UIKit.UIColor value) [0x00003] in <5ea3f71d824c4ee79e20a123731c7acf>:0
at Xamarin.Forms.Material.iOS.MaterialTextManager.ApplyTheme (Xamarin.Forms.Material.iOS.IMaterialTextField textField, Xamarin.Forms.Material.iOS.IMaterialEntryRenderer element) [0x00059] in D:\a\1\s\Xamarin.Forms.Material.iOS\MaterialTextManager.cs:51
at Xamarin.Forms.Material.iOS.MaterialTextManager.Init (Xamarin.Forms.Material.iOS.IMaterialEntryRenderer element, Xamarin.Forms.Material.iOS.IMaterialTextField textField, Xamarin.Forms.Internals.IFontElement fontElement) [0x0004d] in D:\a\1\s\Xamarin.Forms.Material.iOS\MaterialTextManager.cs:26
at Xamarin.Forms.Material.iOS.MaterialTextField..ctor (Xamarin.Forms.Material.iOS.IMaterialEntryRenderer element, Xamarin.Forms.Internals.IFontElement fontElement) [0x00006] in D:\a\1\s\Xamarin.Forms.Material.iOS\MaterialTextField.cs:18
at Xamarin.Forms.Material.iOS.MaterialEntryRenderer.CreateNativeControl () [0x00000] in D:\a\1\s\Xamarin.Forms.Material.iOS\MaterialEntryRenderer.cs:10
at Xamarin.Forms.Platform.iOS.EntryRendererBase1[TControl].OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs1[TElement] e) [0x00020] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\EntryRenderer.cs:107
at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x00122] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:277 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:144
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48
at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:264 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:144
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48
at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:264 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:144
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48
at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:264 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:144
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48
at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:264 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:144
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48
at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:264 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:144
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48
at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:264 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:144
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48
at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:264 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:144
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48
at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:264 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:144
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48
at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:264 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:144
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48
at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:264 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:144
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48
at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidLoad () [0x0008f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:238
at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper(intptr,intptr)
at UIKit.UIViewController.get_View () [0x0002a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/UIViewController.g.cs:3171
at Xamarin.Forms.Platform.iOS.PageRenderer.get_NativeView () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:104
at Xamarin.Forms.Platform.iOS.PageRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0003d] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:120
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.ShellSectionRenderer.PushPage (Xamarin.Forms.Page page, System.Boolean animated, System.Threading.Tasks.TaskCompletionSource1[TResult] completionSource) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ShellSectionRenderer.cs:379 at Xamarin.Forms.Platform.iOS.ShellSectionRenderer.OnPushRequested (Xamarin.Forms.Internals.NavigationRequestedEventArgs e) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ShellSectionRenderer.cs:298 at Xamarin.Forms.Platform.iOS.ShellSectionRenderer.OnNavigationRequested (System.Object sender, Xamarin.Forms.Internals.NavigationRequestedEventArgs e) [0x00024] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ShellSectionRenderer.cs:234 at Xamarin.Forms.ShellSection.OnPushAsync (Xamarin.Forms.Page page, System.Boolean animated) [0x00065] in D:\a\1\s\Xamarin.Forms.Core\Shell\ShellSection.cs:491 at Xamarin.Forms.ShellSection.GoToAsync (Xamarin.Forms.NavigationRequest request, System.Collections.Generic.IDictionary2[TKey,TValue] queryData, System.Boolean animate) [0x00200] in D:\a\1\s\Xamarin.Forms.Core\Shell\ShellSection.cs:285
at Xamarin.Forms.Shell.GoToAsync (Xamarin.Forms.ShellNavigationState state, System.Boolean animate, System.Boolean enableRelativeShellRoutes) [0x001df] in D:\a\1\s\Xamarin.Forms.Core\Shell\Shell.cs:444
at HthApp.Api.HthApi.ItemSearchOpenAsync () [0x0002a] in /Users/matthew.bailey/Projects/hthapp/HthApp/Api/HthApi.cs:1519
at HthApp.Api.HthApi+<>c.b__53_3 () [0x00019] in /Users/matthew.bailey/Projects/hthapp/HthApp/Api/HthApi.cs:330
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021
at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/Foundation/NSAction.cs:178


Changing View from public to internal with XAML (x:ClassModifier)

$
0
0

Hi,

I have a question regarding the internal XAML Class Modifier.

I tried to set it to x:ClassModifier="internal" or x:ClassModifier="NotPublic"
But by doing so I get the compiler error CS0262 (Partial declarations of 'type' have conflicting accessibility modifiers)
because I have already changed my codebehind file to internal also.

By looking at the *.g.cs File I see that the generated code is public partial class … so I think it is not respecting
that x:ClassModifier Keyword or I am doing something wrong here ?

LinearItemsLayout ignores ItemSpacing property on UWP

$
0
0

I'm using a CollectionView with a LinearItemsLayout. I set the ItemSpacing to zero which works on Android and iOS but it doesn't work on UWP - there is always a spacing between items. The orientation property doesn't make any difference - the problem is there for vertical and horizontal views.

<CollectionView.ItemsLayout>

</CollectionView.ItemsLayout>

Is there a fix for this?

Can we send whatsapp's messages from a xamarin forms app?

$
0
0

I mean, in the same way you can send SMS from android's messenger service I want to do the same but sending whatsapps from my xamarin forms app. That's possible?

data is getting differnt from one version of android to another version in xaamrin form s

$
0
0

Can any one help me on this
Data is getting from API is differnt from one version of android to another version of android device in xamarin forms. Per example Data changes happens from 6 version to 7 version of android, 6 th version working fine but 7 version of android device .
Please help me on this .

Accessibility Problem: VoiceOver read AutomationProperties.Name but didn't read Text !

$
0
0

Hello World!!
We aims to support accessibility in our Xamarin.forms App but when we Add AutomationProperties.Name to the label the VoiceOver read it and never read the Value of Text property

here is the code

<controls:ExtendedLabel x:Name="MSGLBL" Margin="8,0" HorizontalOptions="EndAndExpand" VerticalOptions="CenterAndExpand" TextColor="Gray" FontSize="12" Text="{Binding Msg_content}" AutomationProperties.IsInAccessibleTree="true" AutomationProperties.Name="{local:TranslateExtension ResourceId=LocalInboxDetails, Text=LBLMsgContent}">

Is there any solution or suggestions?

thanks !

Map page won't open unless location service is on

$
0
0

My map page loads fine and zooms into the user's current location when location is enabled. However, if I deny permission to use my location, the app freezes when I click on the map page and I get the following error:

Java.Lang.SecurityException: my location requires permission ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION

However, I still want the map to load even when the user denies permission for location.

Xamarin Forms 4.3 Shell Search Handler how to disable query clear on complete

$
0
0

Hi!

I'm trying to integrate an app with the new Shell from Xamarin Forms 4.x. I'm using the latest 4.3 version (4.3.0.947036).

My issue is, when I tap the Enter button on the keyboard of the new SearchHandler that comes with Shell, the text on the searchbar automatically clears. I can't find a place where I can override or disable this behavior. I'm using a search per character inserted feature that I've created on a custom SearchHandler class, and when the search bar clears the search happens again with no characters (which I don't want).

Do you know any specific method or event that I can override or disable to avoid this "clear" behavior?


Trying to get namespace right for an Effect

$
0
0

I am following Adam Pedley's excellent article on effects: https://xamarinhelp.com/safeareainsets-xamarin-forms-ios/

Unfortunately, When I go to the xaml code that wants to use the effect, it rejects the namespace I'm using. I've been banging my head against this for some time.

I've copied SafeAreaPaddingEffect.cs as is (my solution is named Enterprise)

In MainPage.xaml I have

xmlns:effect="clr-namespace:Enterprise.View.Effects">

and VS lights up Effects in red. Further when I try to use that namespace,

      <ContentView.Effects>
            <effect:SafeAreaPaddingEffect />
        </ContentView.Effects>

It lights up SafeAreaPaddingEffect in red as well.

Any ideas/suggestions?

Thanks!!
jesse liberty

CollectionView: Putting the Footer at the Bottom

$
0
0

I have 2 CollectionView(s) (one is the ItemTemplate of the other), and I want to use the full height so that the Footer is at the bottom (which means there may end up being space between the items & the footer). However, my code seems to be placing the Footer immediately below the last item, or chopped off if there are more items than fit. Here is my code & a screenshot:

<CollectionView Grid.Column="1" Grid.RowSpan="3" BackgroundColor="Transparent" HorizontalOptions="Start" HorizontalScrollBarVisibility="Never" Margin="0" VerticalOptions="FillAndExpand" VerticalScrollBarVisibility="Never">
    <d:CollectionView.ItemsSource>
        <x:Array Type="{x:Type sp:SamplePlayer}">
            <sp:SamplePlayer PlayerIndex="0">
                <sp:SamplePlayer.HeaderData><sp:HData PlayerIndex="0" Name="Nate"/></sp:SamplePlayer.HeaderData>
                <sp:SamplePlayer.FooterData><sp:FData PlayerIndex="0" Total="50"/></sp:SamplePlayer.FooterData>
                <sp:SamplePlayer.ScoreData>
                    <sp:Score Points="10" IsSelected="False"/>
                    <sp:Score Points="20" IsSelected="False"/>
                    <sp:Score Points="-10" IsSelected="False"/>
                    <sp:Score Points="30" IsSelected="False"/>
                </sp:SamplePlayer.ScoreData>
            </sp:SamplePlayer>
            <sp:SamplePlayer PlayerIndex="1">
                <sp:SamplePlayer.HeaderData><sp:HData PlayerIndex="1" Name="Player 1"/></sp:SamplePlayer.HeaderData>
                <sp:SamplePlayer.FooterData><sp:FData PlayerIndex="1" Total="50"/></sp:SamplePlayer.FooterData>
                <sp:SamplePlayer.ScoreData>
                    <sp:Score Points="10" IsSelected="False"/>
                    <sp:Score Points="20" IsSelected="False"/>
                    <sp:Score Points="-10" IsSelected="False"/>
                    <sp:Score Points="30" IsSelected="False"/>
                </sp:SamplePlayer.ScoreData>
            </sp:SamplePlayer>
        </x:Array>
    </d:CollectionView.ItemsSource>
    <CollectionView.ItemTemplate>
        <DataTemplate x:DataType="{x:Type sp:SamplePlayer}">
            <CollectionView BackgroundColor="{Binding PlayerIndex,Converter={StaticResource ScoreColors}}" Header="{Binding HeaderData}" Footer="{Binding FooterData}" ItemsSource="{Binding ScoreData}" HorizontalOptions="Start" HorizontalScrollBarVisibility="Never" Margin="0" SelectionMode="Single" VerticalOptions="FillAndExpand" VerticalScrollBarVisibility="Never">
                <CollectionView.HeaderTemplate><DataTemplate x:DataType="{x:Type sp:HData}"><Frame BackgroundColor="{Binding PlayerIndex,Converter={StaticResource NameColors}}" Padding="0,-4,0,4" HorizontalOptions="FillAndExpand" VerticalOptions="Center"><Label Style="{StaticResource ItemText}" Text="{Binding Name}" HorizontalOptions="CenterAndExpand"/></Frame></DataTemplate></CollectionView.HeaderTemplate>
                <CollectionView.ItemTemplate>
                    <DataTemplate x:DataType="{x:Type sp:Score}">
                        <Frame BackgroundColor="Transparent" Padding="0,-4,0,0" HorizontalOptions="FillAndExpand" VerticalOptions="StartAndExpand">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"><VisualState.Setters><Setter Property="BackgroundColor" Value="Transparent"/></VisualState.Setters></VisualState>
                                    <VisualState x:Name="Selected"><VisualState.Setters><Setter Property="BackgroundColor" Value="Orange"/></VisualState.Setters></VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Label Style="{StaticResource ItemText}" Text="{Binding Points}"/>
                        </Frame>
                    </DataTemplate>
                </CollectionView.ItemTemplate>
                <CollectionView.FooterTemplate><DataTemplate x:DataType="{x:Type sp:FData}"><Frame BackgroundColor="{Binding PlayerIndex,Converter={StaticResource NameColors}}" Padding="0,-4,0,0" HorizontalOptions="FillAndExpand" VerticalOptions="Center"><Label Style="{StaticResource ItemText}" Text="{Binding Total}"/></Frame></DataTemplate></CollectionView.FooterTemplate>
            </CollectionView>
        </DataTemplate>
    </CollectionView.ItemTemplate>
</CollectionView>

As you can see, the pink area (the BackgroundColor of the CollectionView) goes all the way to the bottom, but the Footer (the red area) is immediately below the items. How can I move the Footer to the bottom? I am somewhat new to Xamarin (I am converting my apps from UWP to be used on Android). Thanks.

webview open new blank page in browser

$
0
0
public MainPage()
    { 
    Title = "XXXXXX";

        var source = new UrlWebViewSource();
    source.Url = "http://XXXXXXXXX/student/studentlogin.aspx";
        var webView = new WebView
        {
            HorizontalOptions = LayoutOptions.FillAndExpand,
            VerticalOptions = LayoutOptions.FillAndExpand,
            Source = source
        };
        webView.Navigating += (s, e) =>
        {
            if (e.Url.Contains("FeeReceipt.aspx"))
            {
                try
                {
                    var uri = new Uri(e.Url);
                    Device.OpenUri(uri);
                }
                catch (Exception)
                {
                }

                e.Cancel = true;
            }

    };
webView.Navigated += (object sender, WebNavigatedEventArgs e) => {
            System.Diagnostics.Debug.WriteLine("Done");
        };

Content = new ContentView {
            Content = new StackLayout {
                Children = {
                    webView
                }
            }
        };
    }

not showing Camera option in webview of xamarin forms application

$
0
0

Hello,

I have created my application in asp.net mvc and I have given Input type="file" and added PWA in my web application. In browser it shows capture image and select image option. That web application hosted link I have given in my xamarin forms application and I have given camera and storage permission in android and IOS application It works good in IOS. But in android it is not showing capture camera option. Please help me out.

Xamarin.Forms previewer needs a Manual Refresh button

$
0
0

I've had to recreate a new content page, close and open it (the official advise) just to update the preview. This is insane.

Can we get a refresh button?

Viewing all 91519 articles
Browse latest View live


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