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

XF3.0 - UISegmentedControl disappear

$
0
0

Hello,
I have a xf page where I build the StackLayout :
if #if __ANDROID__ I add a FloatingActionMenu to view
if #if __IOS__ I add a UISegmentedControl to view

After udating to xf3.0 the UISegmentedControl disappear..the code that create it is executed, but the SegmentedControl is not visible into device

I create all the page using code, the listview under the UISegmentedControl is displayed.


How to add checkbox,radiobutton in xaml file?

$
0
0

Hello all,
I am trying to add checkbox and radiobutton in xaml file by adding XLabs.Platform. It showing me error that "package XLabs.Platform 2.0.5782 was restored using .NET framework version=v4.6.1 instead of project target framework .NET standard version =v2.0 this package may fully compatible with your project".

What i need to do?. Please help me. I need checkbox and radiobutton.

local Calender using xamarin.forms

$
0
0

How to am create event to device local Calender using xamarin.forms, plz help to me!!!!!!

Kindly Help: Error: AnalyticsListenerImplementor is not abstract and does not override abstract meth

$
0
0

Hi,

My app started throwing this error in my PCL's Android applocation

Error: error: AnalyticsListenerImplementor is not abstract and does not override abstract method onRenderedFirstFrame(EventTime,Surface) in AnalyticsListener
public class AnalyticsListenerImplementor

What could be the reason for this please?

Thanks,
Jassim

Xamarin Forms app is crashing with unknown reason

$
0
0

Hello guys

I have a lot of crash reports in Google Play Console for my xamarin.forms app without any understandable stack trace and possibility to get the reason of the issue. There is only the message below:

tgkill

backtrace:
  #00  pc 000000000004a230  /system/lib/libc.so (tgkill+12)
  #01  pc 00000000000479c3  /system/lib/libc.so (pthread_kill+34)
  #02  pc 000000000001d9c5  /system/lib/libc.so (raise+10)
  #03  pc 0000000000019511  /system/lib/libc.so (__libc_android_abort+34)
  #04  pc 0000000000017150  /system/lib/libc.so (abort+4)
  #05  pc 0000000000284ec4  /data/app/com.nyxbull.nswallet-2/lib/arm/libmonosgen-2.0.so

That's it.
Could anybody help me to understand how to catch actual reason of the issue in this case?

Thanks!

How to turn on camera flash on all devices

$
0
0

Hi,

I am new to Xamarin Forms. I found a link to turn on camera flash in android device using Xamarin. But may I know how can I implement the same using Xamarin forms for 3 platforms?

The link is here http://forums.xamarin.com/discussion/24237/camera-led-or-flash

My requirement is to add a button. On clicking this button camera flash should turn on/off on dependent devices. Can anyone help me in this?

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.

how to create scheduling calendar control using xamarin forms

$
0
0

how to create scheduling calendar control using xamarin forms


Help: Upgrading from 2.3.4 to 3.0. Android Contents are offset downwards

$
0
0

I had to update a year-old app to the current version of forms. Unfortunately on Android, it seems to think the screen is taller then it actually is (see screen shot). Everything is working just fine for iOS, but all my pages are slightly taller than the screen on Android on multiple devices.

Some things I have tried:

  • Made sure I'm using the latest SDK's and latest Android Support files
  • Hacked in a padding (worked on modal pages, not on MainPage)

Layout description:
Depends on the idiom: On a phone, it's a MasterDetail with a Tabbed Page as Detail, a Navigation Page for the first Child of Tabbed Page (so Menu appears for only that page), and Content Pages for the rest. For Tablet, the Children of the Tabbed pages are all Content Pages. Modal Pages are all Content Pages.

Any help on this would be greatly appreciated.

How can I use Google's Geocoding API on my map?

$
0
0

I have a search bar on my map page, and I'd like to use google's geocoding API to convert user's text input into coordinates. I'm currently using the geolocator plugin but it doesn't work as I want it to (If I type in a zipcode, it won't recognize it. Google maps does)

UWP Editor Alignment Issue

$
0
0

In UWP. The expected behavior is that upon setting the Editor text it is display aligned to the top, but no matter what I have tried is always aligned to the bottom. Yes, I have looked into every single forum and have not found anything closer to a solution. Alternatively is there any UI Library that provides one with this expected behavior I will like also to know about since I have not found any that offers an editor (again for UWP).

Can you help?

Ed.

Xamarin.Forms 2.3.4.224 iOS crashing on ObservableCollection changed

$
0
0

Tried updating to the new version on iOS but it is crashing on an ObservableCollection binded to a ListView . The errors is:

0x00000001000f41a8 0x00000001000dc2a4 0x000000010041eaf8 0x0000000100367094 0x0000000100d344fc 0x0000000100d32ef8 0x0000000100bc82a8 0x0000000100bca834 0x0000000100bc98c8 0x0000000100bf4fa8 0x0000000100bf5cb0 0x0000000100bf4f48 0x0000000100bf5aa4 0x000000
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (1 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).'

Returned to 2.3.3.193.

Any idea what is wrong?

Thanks,
Dan

Binding to an Object/Field/Property Defined In CodeBehind

$
0
0

I'm pretty knew to data binding with Xamarin. It seems like a really powerful tool that comes at a cost of complexity. I've been reading forums for hours and cannot figure this out.

Let's say I have a class:

MyPage.xaml.cs

namespace NS
{
    public class CustomObject
    {
        public DateTime CreatedAt { get; set; } //I have tried with implementing INotifyPropertyChanged as well
    }

    public partial class MyPage
    {
        public CustomObject Instance;
        public MyPage() { }
    }
}

and xaml

MyPage.xaml

<ContentPage ... BindingContext="{Binding Instance}">

    <Label x:Name="Label1" Text="{Binding CreatedAt}"/>

</ContentPage>

My question is how do I bind the Text property of Label1 to the CreatedAt property of Instance, using xaml. I know this is really simple but maybe I will learn something fundamental here.

Many thanks for any clarity you can share!

Erroe in android debug with a missing moethod

$
0
0

I have this error in android device, in the App.xaml.g.cs

"System.MissingMethodException: System.Func`2<string, string> Xamarin.Forms.Internals.ResourceLoader.get_ResourceProvider()
"

Anyone know something about it?

Why won't PopModalAsync() work on iOS?

$
0
0

For some reason I can not get a certain page in my application to successfully pop from the navigation stack on iOS. I am using the popModalAsync() method without issue in several other areas, but this particular instance always throws a System.ArgumentOutOfRangeException.

`try
{

     Device.BeginInvokeOnMainThread(async () =>
     {
    await curData.currentRootPage.Navigation.PopModalAsync(true);
    //await App.Current.MainPage.Navigation.PopModalAsync(true);
    //await Navigation.PopModalAsync(true);
     });

}`

The commented lines show the other calls I have attempted.
For the record, I am pushing the page via Navigation.PushModalAsync(new PageType()).

Application Specific Information:
*** Terminating app due to uncaught exception 'System.ArgumentOutOfRangeException', reason: 'System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.'

Xamarin Exception Stack:
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00018] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/throwhelper.cs:93
at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/throwhelper.cs:56
at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <0f7865fc4fbb4fddaab6f86c915ebae0>:0
at Xamarin.Forms.Internals.NavigationProxy.PopModal () [0x0000b] in D:\agent_work\1\s\Xamarin.Forms.Core\NavigationProxy.cs:230
at Xamarin.Forms.Internals.NavigationProxy.OnPopModal (System.Boolean animated) [0x00007] in D:\agent_work\1\s\Xamarin.Forms.Core\NavigationProxy.cs:168
at Xamarin.Forms.Internals.NavigationProxy.PopModalAsync () [0x00000] in D:\agent_work\1\s\Xamarin.Forms.Core\NavigationProxy.cs:84
at ESPMobile.CameraPage.b__3_0 () [0x00000] in /Users/clarkin/NewDevelopment/ESPMobile/Pages/CameraPage.xaml.cs:48
at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/Foundation/NSAction.cs:163
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/UIKit/UIApplication.cs:63
at ESPMobile.iOS.Application.Main (System.String[] args) [0x00000] in /Users/clarkin/NewDevelopment/iOS/Main.cs:13


Ideas on how to create a circle that has a smaller overlapping status circle

$
0
0

So I need to create a circle that will hold the users initials. That's easy enough but that circle needs to have a smaller circle that will overlap it in the bottom right hand portion. The smaller circle will be used to represent the user's status i.e. offline, available, busy, do not disturb, etc. Any ideas on how to accomplish something like that or are there any third party controls that could meet the need, thanks!

Update a Picker when getting data from DB using an API

$
0
0

I am playing around with an app to test concepts, I am creating a sports registration app that will allow the user to select a participant and then register them for a sport that falls in line with the participants age and gender. IF the person in question is not listed then they can add them. That is where my issue occurs. I get the data from the DB using an API. Then it populates a picker. My issue is that i can't seem to get the picker to refresh after they add a participant. I tried and observableCollection but could not get it to populate when using the API, (had to hard code the values) Here is my code, if you could give me a hand i would appreciate it. using xamarin 3.0.

using Newtonsoft.Json;
using SportsRegTestApp.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace SportsRegTestApp
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class SelectParticipant : ContentPage
{
public string uri = "...";
List participantList = new List();
HttpResponseMessage response = new HttpResponseMessage();
private ActivityIndicator _activityIndicator = new ActivityIndicator();
HttpClient client = new HttpClient();
string lwaid;
List names = new List();

    public SelectParticipant(string id)
    {
        InitializeComponent();


        lwaid = id;
        uri += id;
        while (IsBusy == true)
        {
            var indicator = new ActivityIndicator { IsRunning = true };
        }

    }

    private async void PopulatePicker()
    {

        response = await client.GetAsync(uri);
        if (response.IsSuccessStatusCode)
        {
            participantList.Clear();
            var content = await response.Content.ReadAsStringAsync();
            participantList = JsonConvert.DeserializeObject<List<Participant>>(content);

            ParticipantNames();
            PickLoading.IsVisible = false;
            ParticipantPicker.IsVisible = true;
            Add.IsVisible = true;
        }

    }


    private void ParticipantNames()
    {
        names.Clear();
        // var index = 0;

        foreach (var person in participantList)
        {
            names.Add(person.firstname + " " + person.middleinitial + " " + person.lastname + " Age:" + ((int.Parse(DateTime.Now.ToString("yyyyMMdd")) - int.Parse(person.dateofbirth.ToString("yyyyMMdd"))) / 10000));
            //index++;
        }

        ParticipantPicker.ItemsSource = names;

    }

    public async void LoadAdd()
    {
        var AddParticipant = new AddPage(lwaid);
        await Navigation.PushModalAsync(AddParticipant, true);

    }

    public async void LoadSports()
    {
        Participant selected = new Participant();
        var i = ParticipantPicker.SelectedIndex;
        if (i >= 0)
        {
            selected = participantList[i];

            var AvailableSports = new AvailableSports(selected);
            await Navigation.PushModalAsync(AvailableSports, true);

            ErrorMsg.IsVisible = false;
            ErrorMsg.Text = "";
        }
        else
        {
            ErrorMsg.Text = "You must choose a participant...";
            ErrorMsg.IsVisible = true;
        }


    }

    protected override void OnAppearing()
    {
        PickLoading.IsVisible = true;
        ParticipantPicker.IsVisible = false;
        Add.IsVisible = false;
        PopulatePicker();
    }

}

}

Sending Azure IoT Hub Job and Receiving Messages generated from the Job via MQTT

$
0
0

Hi, I have been back and forth with Microsoft Support for almost 1 week now - nobody know how to do this apparently. The codes shared with me was not even compiled - probably still in PCL. However, I managed to clean it up and got it working to send simple HTTP message - but MQTT & AMQT are still not working.

Please check out the shared codes to do simple send and receive from/to IoT Hub
GitHub : /Azure/azure-iot-sdk-csharp/tree/master/iothub/device/samples/XamarinSample

If you have successfully create IoT Job and Receive messages from the Azure IoT Hub Job (via MQTT) in Xamarin Forms, please share your solution. Thank you.

Shazam Offline and syncing question

$
0
0

I am in the process of a development for a client (my first). I need to be able to keep the application working while offline. I basically have a bar-code scanner app that creates assets on the fly. My business process or process flow allows for assets being on the go as well (out of office or warehouse etc).

With this in mind, i need to operate if there is no network connection presently. I basically save assets to a local sqlite db and once a connection is established again then those items will sync to the real db. The only app i could think off that displays this functionality well is Shazam.

Shazam is a way to discover music artists, if you like something you hear. If your offline it tells you "1 pending shazam" then once you gain a network connection it automatically queries Shazam and then adds the Shazams to "My Shazams" (a list of all queries you have made).

I am looking to replicate this functionality, would anyone have tips, nuget package knowledge, or logic or links to lead me on the discovery path!

Cheers in advance!

Grid inside ScrollVIew

$
0
0

Hi is it possible to put Grid inside ScrollView the Grid will act as header for ScrollView if possible how

Viewing all 91519 articles
Browse latest View live


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