Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

Detect if Image not visible to user | ScrollView | COntentPage

$
0
0

Hi.
I Have 1 problem.

I have ContentPage.

In the start of this page i have Image element and another content in stack layout etc...
All content inside Scroll View

Now I want to catch, when user scroll down, and when IMAGE NO DISPLAY to user.

What is th e best way to catch that user doesn`t see the Image???


Double-tapping in Xamarin.Forms on Android

$
0
0

We've found some rather annoying issues with multiple taps and navigation on Android using Xamarin.Forms. Let's say there's a button press and in the handler there's a bog-standard await Navigation.PushAsync(new SomePage()).

If you're really fast, you can tap the button multiple times, pushing multiple pages on to the stack.

This class of bug also happens when dismissing pages. Suppose you have a button with a handler with an await Navigation.PopAsync(). If you're really fast, you can multiple-tap that button as it animates away; in our test cases, this often caused a crash mentioning jobject being equal to IntPtr.Zero or something.

We've managed limited mitigation by storing a time-of-last-tap and swallowing excess taps within a certain threshold of the previous successful tap, but this seems very kludgey...

Ideally pages should not respond to touch events unless they're the top page on the navigation stack and there's no page-related animation happening. Is there a good general solution to this?

By the way, you can see this in the Xamarin Evolve app. Go to a session, multi-tap Send Feedback, and watch a bunch of feedback windows push onto the stack. Or multi-tap Cancel and watch a bunch of them dismiss. (In this case it doesn't seem to crash.)

Release Version works but gives many warnings: but no debug symbols file was found.

$
0
0

Using latest release, I am getting the following only on a Release build even though the app works fine:

Severity Code Description Project File Line Suppression State
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.GooglePlayServices.Tasks.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.v7.MediaRouter.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.GooglePlayServices.Base.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Arch.Core.Common.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Arch.Lifecycle.Common.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Forms.Maps.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.v7.CardView.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.Annotations.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.Vector.Drawable.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.Transition.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Forms.Platform.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.Media.Compat.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.Fragment.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.GooglePlayServices.Basement.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains MyToolkit.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.v4.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.Design.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.Core.Utils.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Forms.Maps.Android.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.Core.UI.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.v7.Palette.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.GooglePlayServices.Maps.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Java.Interop.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Plugin.CurrentActivity.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.v7.RecyclerView.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.Animated.Vector.Drawable.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.Compat.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Support.v7.AppCompat.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid90\android/assets contains Xamarin.Android.Arch.Lifecycle.Runtime.dll but no debug symbols file was found. 0

I have tries all advice from other similar threads but non solve this issue.

Anyone able to solve this?

Nathan

How to Parse JSON Object Array of Data into Views?

$
0
0

Hi,

Well i am knew to Xamarin and confuse of how to parse the JSON object content/array of content into views/component. The purpose of this is that i have a online VPS in the cloud, with MySQL Database there. I put the .php files up and call it using URL to return (in JSON object) the data i query. So, this is what i already know from the web service method:

  1. Request HttpURLConnection (Build Strings for example: http://101.10.30.890/index.php?hello=20?testing=10/)
  2. Then my index.php file return JSON object which i can parse (how to parse the object in it?)
  3. If i'm not mistaken using the Class which extends AsyncTask is the best approach, for example:
    class FetchTask extends AsyncTask<String, Void, String>
    which includes onPreExecute, During, and OnPostExecute method?

Please correct me if i am wrong, i am just trying to understand how to get the data into my views (Entry and Label for example). I already know how to request the data and return it, what i am missing is how to parse it and put it into my views. Any help is appreciated :)

Regards,
Kevin

How to show heads up notification?

$
0
0
I was wondering How can i show heads up notification on xamarin android using the plugin Xam.plugins.Notifier.
Thanks

MVVM pattern in xamarin.android

$
0
0

Can any one plz tell me that we can apply mvvm pattern in xamarin.android the same way like we apply in xamarin.forms if yes then plz give me a reference about that or any example will be helpful

iPhone/iPad Support w/Geolocation

$
0
0

My iPhone app is working perfect with Geolocation properly setup. When I distribute the app a lot of older iPads aren't compatible because they don't have a GPS sensor. TestFlight indicates "Incompatible Hardware."

The GPS usage in the app is optional, we fallback to zip code search. Is there a way I can support older iPads (with iOS v8+) and iPhones with GPS?

How to add buttons into the renderer map pin?

$
0
0

Is it possible to add some buttons into the rendered map pin and every button can trigger its associated event? If so, how to do it?


How to keep man pin event after render it on ios

$
0
0

Xamarin introduce a sample to customize the map pin

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/map/customized-pin

In this sample, I try to use pin's original event (defined in Xamarin Form) like this way

    public MapPage()
    {
        InitializeComponent();

        var pin = new CustomPin
        {
            Type = PinType.Place,
            Position = new Position(37.79752, -122.40183),
            Label = "Xamarin San Francisco Office",
            Address = "394 Pacific Ave, San Francisco CA",
            Id = "Xamarin",
            Url = "http://xamarin.com/about/"
        };
        pin.Clicked += Pin_Clicked;
        customMap.CustomPins = new List<CustomPin> { pin };
        customMap.Pins.Add(pin);
        customMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(37.79752, -122.40183), Distance.FromMiles(1.0)));
    }

    private async void Pin_Clicked(object sender, System.EventArgs e)
    {
        await DisplayAlert("Alert", ((CustomPin)sender).Label, "OK");
    }

For Android, I comment the following line in OnElementChanged
NativeMap.InfoWindowClick -= OnInfoWindowClick;
and
NativeMap.InfoWindowClick += OnInfoWindowClick;
in OnMapReady

    protected override void OnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs<Map> e)
    {
        base.OnElementChanged(e);

        if (e.OldElement != null)
        {
            //NativeMap.InfoWindowClick -= OnInfoWindowClick;
        }

        if (e.NewElement != null)
        {
            var formsMap = (CustomMap)e.NewElement;
            customPins = formsMap.CustomPins;
            Control.GetMapAsync(this);
        }
    }

    protected override void OnMapReady(GoogleMap map)
    {
        base.OnMapReady(map);

        //NativeMap.InfoWindowClick += OnInfoWindowClick;
        NativeMap.SetInfoWindowAdapter(this);
    }

the pin event can be fired correctly after tap the pin's info window

But on iOS devices, after I commented out nativeMap.CalloutAccessoryControlTapped in OnElementChanged. The event can't be triggered:

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

        if (e.OldElement != null)
        {
            var nativeMap = Control as MKMapView;
            nativeMap.GetViewForAnnotation = null;
            //nativeMap.CalloutAccessoryControlTapped -= OnCalloutAccessoryControlTapped;
            nativeMap.DidSelectAnnotationView -= OnDidSelectAnnotationView;
            nativeMap.DidDeselectAnnotationView -= OnDidDeselectAnnotationView;
        }

        if (e.NewElement != null)
        {
            var formsMap = (CustomMap)e.NewElement;
            var nativeMap = Control as MKMapView;
            customPins = formsMap.CustomPins;

            nativeMap.GetViewForAnnotation = GetViewForAnnotation;
            //nativeMap.CalloutAccessoryControlTapped += OnCalloutAccessoryControlTapped;
            nativeMap.DidSelectAnnotationView += OnDidSelectAnnotationView;
            nativeMap.DidDeselectAnnotationView += OnDidDeselectAnnotationView;
        }
    }

Do you have any idea to solve the malfunction of pin event on iOS?

How create this UI? (Sample Picture inside)

$
0
0

Hi everyone,

I want this wavy layout, but don't known how to do it

I wish everyone a good day :)

Xamarin Forms - FontAwesome works iOS,Android but UWP display [x]

$
0
0

Hello dear Xamariners !

I'm wasting a lot of time trying to figure out why FontAwesome doesn't work on Android & iOS.
No need to tell you that I've tried several solutions I found on this forum.

To help you to help me (what ? haha)
Here are some screenshots :

On iOS :

On UWP or Android (kind of same result I don't have the right icon)

The FontFamily resource in app.xaml :

My Fonts folder :

My VS fonts Android folder with the properties AndroidAsset // copy if newer

My VS fonts UWP folder with the properties Content // Do not copy

Do you have any idea why it isn't working ?

I've tried several way to declare my font (without the otf.#name of font , with .otf#name of font style , with .otf only)

If anybody got this working, it would be awesome :) to get some help.
PS : I'd like to avoid a custom renderer

I wish you all a good weekend !

iOS app crashes when saving camera photo, but only in app store version

$
0
0

I have an iOS app that works fine on my iPad in debug mode. When I archive it and install it from XCode in ad-hoc mode it also works fine.

When I take the same archive and sign it for the app store and download it from there it crashes when I try and save a photo taken with the camera.

My crash log is showing

libsystem_kernel.dylib
__abort_with_payload
libsystem_kernel.dylib
abort_with_payload
TCC
__CRASHING_DUE_TO_PRIVACY_VIOLATION__
TCC
__TCCAccessRequest_block_invoke.77
TCC
__tccd_send_message_block_invoke
libxpc.dylib
_xpc_connection_reply_callout

Clearly, that suggests a privacy violation, but I am requesting permission from the app and granting it as a user. Any ideas what could be causing this and why it only affects the App Store release?

Send Slider Value

$
0
0

Hi guys. I written a custom slider class and I want to send the value selected on another view by clicking on button, but I don't know how do it.
Can you help me?

How to set the Selected Item of a Picker Control through View Model (MVVM)

$
0
0

Hi there,

I will try to explain this as best I can so please bare with me:

Background:

I have two pages that interact with each other - a customer page (CustomerPage) which stores a listing of customers and an edit page (CustomerEditPage) used to add new customers or edit customers passed in from the customer page list. I am able to pass the Customer class of the selected customer in the customer page to the edit customer page without issue. I am also able to set all of the Entry controls to the values through passing the values. In addition to the Entry controls I also have a Picker control used to store location name values (e.g. 123 West St, 85 George St, etc.). It has an ItemSource that loads successfully through the view model. However I have an issue when trying to specify the selected item from a value passed to the view model on load. The bound property fires and shows it being set, but the control does not show anything selected after load in the application. If I click on the control, my values are there but again nothing is selected.

Can someone help me explain how I can set the selected item?

Things I have tried:

  • Ensuring the ItemSource is loaded before the SelectedItem value is set
  • Put a break-point on the Handles_ItemSelected event to see when it is firing (*Note it only fires when I select an item from the list and NOT when set through code in the view model)
  • Adding an ID column to the CustomerLocation class to see if the Picker needed a key value

Item Selected from ListView in CustomerViewModel.cs

        ItemSelectedCommand = new Command(async () =>
        {
            await navigationService.NavigateModelAsync(PageNames.CustomerEditPage, Customer, true, false);
        });

This works as expected

Picker Control from CustomerEditPage.xaml

        <Picker ItemsSource="{Binding Locations}" 
                ItemDisplayBinding="{Binding LocationName}"
                SelectedItem="{Binding CustLocation, Mode=TwoWay}"
                SelectedIndexChanged="Handle_SelectedIndexChanged"/>

*Note that the SelectedIndexChanged was only set so I can see when it was firing

CustomerEditPage.xaml.cs

    public CustomerEditPage(CustomerEntry customer)
    {
        var vm = new ViewModels.CustomerEditViewModel(App.NavigationService);
        BindingContext = vm;

        if (customer != null || customer.ID > 0)
        {
            vm.EditCustomer = customer;
            vm.SetEditCustomer();
        }

        InitializeComponent();
    }

    void Handle_SelectedIndexChanged(object sender, System.EventArgs e)
    {
        //Testing to see if we get to this break-point
    }

As you can see, I take in the CustomerEntry class object. I check if it is not null and has an ID > 0 and if so passes to the ViewModel to set the controls. Again, the Handle_SelectedIndexChange is only fired for testing purposes (using a breakpoint).

CustomerEditViewModel.cs

    private CustomerEntry editCustomer;
    public CustomerEntry EditCustomer
    {
        get { return editCustomer; }
        set
        {
            editCustomer = value;
            OnPropertyChanged("EditCustomer");
        }
    }

    private ObservableCollection<CustomerLocation> locations = new ObservableCollection<CustomerLocation>();
    public ObservableCollection<CustomerLocation> Locations
    {
        get { return locations; }
        set 
        {
            locations = value;
            OnPropertyChanged("Locations");
        }
    }

    private CustomerLocation custLocation;
    public CustomerLocation CustLocation
    {
        get { return custLocation; }
        set
        {
            custLocation = value;
            OnPropertyChanged("CustLocation");
        }
    }

    public CustomerEditViewModel(INavigationService navigationService)
    {
        SubmitCommand = new Command(async () =>
        {
            await OnSubmit();
            await navigationService.NavigateModelAsync(PageNames.CustomerPage, null, true, true);
        });

        CancelCommand = new Command(async () =>
        {
            await navigationService.GoBack();
        });

        LoadLocations();
    }

    public async Task LoadLocations()
    {
        List<CustomerLocation> loadLocations = await App.Database.GetLocationsAsync();
        Locations = new ObservableCollection<CustomerLocation>(loadLocations);
    }

    public void SetEditCustomer()
    {
        ID = EditCustomer.ID;
        CustomerName = EditCustomer.CustomerName;
        CustLocation = new CustomerLocation() 
        { 
            LocationName = EditCustomer.LocationName
        };
        Email = EditCustomer.Email;
        Notes = EditCustomer.Notes;
    }

The EditCustomer, Locations and CustLocation properties all fire. Properties for ID, CustomerName,Email and Note omitted for brevity.

Locations are loaded from a SQLiteAsyncConnection (database is located on device)

CustomerLocation.cs

public class CustomerLocation
{
    public string LocationName { get; set; }
}

As mentioned above, I put a mock ID column in this class (I didn't actually designate it as a key now that I think about it - I am not sure if that makes a difference).

CustomerEntry.cs

public class CustomerEntry
{
    [PrimaryKey, AutoIncrement]
    public int ID { get; set; }

    public string CustomerName { get; set; }
    public string LocationName { get; set; }
    public string Email { get; set; }
    public string Notes { get; set; }
    public DateTime TimeStamp { get; set; }
}

CustomerEntry class here for reference purposes.

Shadow Effect sample appears not to work

$
0
0

Hi, I have downloaded the xamarin-forms-samples from github. Using the the xamarin-forms-samples-master\Effects\ShadowEffect\EffectsDemo.sln and running this on the Android emulator produces no visible effect whatsoever.

Am I doing something wrong? or is this sample just outdated?


ListView different CellSizes

$
0
0

Hey,

Is there a way to display this layout?

Is there a plugin like this (github.com/bryceredd/RFQuiltLayout) for Xamarin.Forms?

Login via Xamarin Android UI instead of server side login page, IdentityServer4, ASP.NET CORE

$
0
0

I wonder if it is possible to use Xamarin Android UI as a login page instead of getting directed to server side login page, which allows the mobile app to authenticate users by communicating with server side behind the scenes.

The reason is that we want to avoid the redirecting from mobile to server side, and back to mobile app.

Can anyone provide links on how to implement this case in single sign on?

I found some samples below, but none of these has the sample.
https://github.com/IdentityModel/IdentityModel.OidcClient.Samples

Weird Pressed shadow in android after updating to XF 2.5

$
0
0

Hello
After upgrading to XF 2.5 I have a weird small shadow on every android button after pressing them.
https: //drive.google.com/open?id =1V3LMp5o1f8hwaPZL3jTA4b8jJToyq-5t
here is a video of what happens after I press a button.

here is the code of the button

                <Button HeightRequest="60"
                        x:Name="CameraButton"
                        Image="camera_cyan.png"
                        Clicked="OnCameraClicked" 
                        FontSize="Medium"
                        CornerRadius="5"
                        TextColor="{StaticResource Primary}"
                        BackgroundColor="{StaticResource PrimaryAlternate}"/>

I need to help Multipart for to send a image to server

$
0
0

Hi! My first time here
I need to help to send a image to server with Multipart.
I tried but without sucess. A tutorial ?

I need to help Multipart for to send a image to server

$
0
0

Hi! My first time here
I need to help to send a image to server with Multipart.
I tried but without sucess. A tutorial ?

Viewing all 204402 articles
Browse latest View live


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