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

Bottom Tabbed page issues

$
0
0

I am trying to use a bottom Tabbed Page for Xamarin Forms (Android).
I have this error message:
'IPlatformElementConfiguration<Android, TabbedPage>' does not contain a definition for 'SetToolbarPlacement' and no extension method 'SetToolbarPlacement' accepting a first argument of type 'IPlatformElementConfiguration<Android, TabbedPage>' could be found (are you missing a using directive or an assembly reference?)
Anyone have the same issue here?
looks like my 'Toolbarplacement' is missing


iOS compiling and debug issues. Can someone please help?!

$
0
0

Hello,

As of this morning, I'm seeing these errors and cannot debug an app on iOS at all, in any simulator.

I have the latest Visual Studio 2017 installed and updates on Windows 10. Same with XCode 9.4.1 and the Simulator 10.0.0 on OSX 10.13.4
All relevant xamarin plugins are updated too.

Running and testing on Android is not an issue and neither was iOS until this AM.

I keep getting this error on building the iOS App:

Severity Code Description Project File Line Suppression State
Error Can't resolve the reference 'System.ReadOnlySpan1<System.Char> System.MemoryExtensions::AsSpan(System.String,System.Int32,System.Int32)', referenced from the method 'System.ReadOnlySpan1<System.Char> Microsoft.Extensions.Primitives.StringSegment::AsSpan()' in 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. myapplication.iOS

If I then select the iOS project and build that only, the build succeeds.

Then, when I try to deploy to the simulator (and I've tried many from iOS 10.3 to 11.1), I get the following error:

This debug engine does not support exception conditions. The condition(s) will be ignored.
The app has been terminated.
Launch failed. The app 'myapplication.iOS' could not be launched on 'iPhone 7 Plus iOS 10.3'. Error: error HE0046: Failed to install the app 'com.mycompany.myapplication' on the device 'iOS 10.3 (14E8301) - iPhone 7 Plus': Failed to chmod /Users/lindsaymiles/Library/Developer/CoreSimulator/Devices/FD1D91C1-65FE-49D2-96AB-78B12816704D/data/Library/Caches/com.apple.containermanagerd/Bundle/Application/0F4BED82-C36B-4E39-9ED9-7479915AAFAF/myapplication.iOS.app/myapplication.iOS : No such file or directory. Please check the logs for more details. The app has been terminated

Can someone (anyone at MS and/or Xamarin) please advise on this as I just cannot seem to find a way around the issue.

Thanks!

Endless problems...

$
0
0

Why there is always problem with Xamarin? Fresh project and:
1. No intelisense for XAML
2. Controls are inaccesible from code (I had to add [XamlCompilation(XamlCompilationOptions.Compile)] and BindingContext = new MainPage();
to get this work)
3. After project creation you have to build it to restore nuget packages
4. Xamarin Live Preview crashes without any error with only Label control. I removed device and added again, still same problem
5. Sometimes it looks for latest ver. of Android SDK even if simulators are for installed ver. of SDK. You have to change a target API or install latest

How you guys are able to work with Xamarin? Maybe it's only me. I'm not interesed in Java. Can someone help me?

PS.
This project is a start project with label control in center. What would happen if I wanna do something more than showing a text in center of screen... -.-'

Xamarin.Android.Common.targets - Name cannot begin with the '$' character, hexadecimal value

$
0
0

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Warning: Name cannot begin with the '$' character, hexadecimal value 0x24.

I am building a Xamarin Forms application and I have been trying to resolve the issue. I just can't find online resources to get me through this. Is there anyone who knows whats causing this. There is no name that starts with '$'.

How to make modules for an app

$
0
0

Hi Community,

I'm developing an app that needs to be extendable through modules: the user can add/delete the modules that he wants to the app and these modules add a complety new set of features. Is it possible to do it in Xamarin.Forms? If so how?

Autocomplete entry and picker does not work at closing and opening the app again

$
0
0

In a page I have an autocomplete entry and a picker. When I open the app and I do the query, it does well, when I write something on the entry it autocomplete, and the picker I can choose the data. The issue comes when I close the app and I do open it again, the entry does not autocomplete and the picker elements are empty.
I saw into the webservice console and the app does the query successfully but the app does not charge the content to picker neither the rentry.
I am using MVVM. This is the page code from the view.

public partial class ExistenciaPage : ContentPage
{

    ExistenciaViewModelMacro existenciaVM;

    public ExistenciaPage ()
    {
        InitializeComponent();
        existenciaVM = new ExistenciaViewModelMacro();
        BindingContext = existenciaVM;
    }

    protected override void OnAppearing()
    {
        try
        {
            base.OnAppearing();
            buscarEntry.ItemsSource = existenciaVM.AutoCompleteDescripcion;
            almacenPicker.ItemsSource = existenciaVM.Almacenes;
        }
        catch (Exception ex)
        {
            string message = ex.Message;
            almacenLabel.Text = message;
        }
    }
};

P.S. Sorry my english is very bad, I'm still learning.

Decompress database

$
0
0

Hi Guys,

i'm looking for a way to decompress my database send from my api, but seems that in the way that i'm doing this is not supported.

Do you know how can i do this?

Alberto C.

Making Xamarin forms app run in background

$
0
0

Hi, I am developing xamarin forms based android app in which I have used Push notifications using OneSignal. Notifications are received successfully and displayed on my app but if I close the app then notifications doesn't get received by app and due to which I get Failure respond on OneSignal dashboard. Can anyone tell me how can I keep running my app in background so that notifications will be handled even if app get closed by user.


how to recored genrated beep sound in Xamarin.forms?

$
0
0

I'm currently coding on Xamarin.Forms application with Xamarin.Andriod and I'm using the AudioRecord class to record my genrated beep sound it working good but not working in Ios.below code is Xamarin.Andriod then how to record my genrated beep sound in xamarin.Ios?
foreach (double dVal in sample)
{
short val = (short)(dVal * 32767);
generatedSnd[idx++] = (byte)(val & 0x00ff);
generatedSnd[idx++] = (byte)((val & 0xff00) >> 8);
}
var track = new AudioTrack(Android.Media.Stream.Music, sampleRate, ChannelOut.Mono, Android.Media.Encoding.Pcm16bit, numSamples, AudioTrackMode.Static);
track.Write(generatedSnd, 0, generatedSnd.Length);
track.Play();
SystemClock.Sleep(500);
track.Release();

how to record genrated sound in Xamarin.Forms ios

$
0
0

I'm currently coding on Xamarin.Forms application with Xamarin.Andriod and I'm using the AudioRecord class to record my genrated beep sound it working good but not working in Ios.below code is Xamarin.Andriod then how to record my genrated beep sound in xamarin.Ios?
foreach (double dVal in sample)
{
short val = (short)(dVal * 32767);
generatedSnd[idx++] = (byte)(val & 0x00ff);
generatedSnd[idx++] = (byte)((val & 0xff00) >> 8);
}
var track = new AudioTrack(Android.Media.Stream.Music, sampleRate, ChannelOut.Mono, Android.Media.Encoding.Pcm16bit, numSamples, AudioTrackMode.Static);
track.Write(generatedSnd, 0, generatedSnd.Length);
track.Play();
SystemClock.Sleep(500);
track.Release();
same way how to record my genrated beep sound in xamarin.Ios.

Use a STL C++ Library

$
0
0

Hello,
How to use a STL C++ Library in a Xamarin project ?
Thank you,
Christophe,

Is anyone actually using the geofence plugin in production?

$
0
0

I have created an app that uses the geofence plugin (https://github.com/domaven/xamarin-plugins/tree/master/Geofence) to notify users when they enter/exit certain locaitons.

It works to some extent, but there are a few problems:
-When monitoring location exit, iOS users experience numerous false exit notifications, especially when moving around inside the location perimeters. Also if moving outside the location, when phone wakes up after being inactive, one can get 3-4 notifications about exiting the location, even if the user is far away
-All proper exit notifications (not the fake ones) are displayed twice on iOS
-On Android, some users don't get notifications at all, especially if the app is in background or closed

I am thinking about moving to the acr geofencing plugin (https://github.com/aritchie/geofences/tree/master/), but it is a bit of work. So I am wondering if:

1.Does anyone else have experience with either of these plugins in production?
2.Anyone else have experience with same problems that I am facing?

It's weird that nobody else seems to have problems. I was a newbie to Xamarin when writing the app, I am thinking of creating a small sample. Maybe I have made mistakes, although I have been going through my code several times without finding any. Maybe nobody is actually using the geofence plugin for other than playing around....

Appreciate any insights on this.

Speed Dial

$
0
0

Hi Xamarin Forum

how to make a speed dial in xamarin forms where I dont need to tap the call button just like the standard phonedialler of xamarin forms, I just need to tap the number I need to call and upon tapping it the phone automatically dial the number and not by displaying the phone number and I will again tap the call button below the phone number

Animating Navigation Bar properties on page transitions

$
0
0

I am looking to add a transition to navigation bar text when navigating between views in a MasterDetail layout. Just a simple fade out / in of the navigation page text.

I have implemented the below custom renderer, which is getting me 99% of the way.

The problem I am having is that it appears when calling PushASync method, the navigation bar text is being updated before the point that SetupPageTransition is called in the Custom NavigationPageRenderer. By debugging I can also see this text is updated before the outgoing pages OnDisppearing method is called.

I can't seem to find any way to trigger the animation before the text is updated, so at the moment the Push transitions behave strangely as it jumps to the new title before fading out. In reality, this was the reason I decided to add this transition in the first place, as I found this behaviour jumpy.

Is there anyway i can trigger this animation before the text is updated?

public class CustomNavigationPageRenderer : NavigationPageRenderer
{
    private Android.Support.V7.Widget.Toolbar toolbar;

    private Android.Support.V7.Widget.AppCompatTextView _textView;

    public CustomNavigationPageRenderer(Context context)
        : base(context)
    {
    }

    public override void OnViewAdded(Android.Views.View child)
    {
        base.OnViewAdded(child);
        if (child.GetType() == typeof(Android.Support.V7.Widget.Toolbar))
        {
            toolbar                     = (Android.Support.V7.Widget.Toolbar)child;
            toolbar.Elevation           = 0;
            toolbar.ChildViewAdded      += Toolbar_ChildViewAdded;
        }
    }

    private void Toolbar_ChildViewAdded(object sender, ChildViewAddedEventArgs e)
    {
        var view                    = e.Child.GetType();

        if (e.Child.GetType() == typeof(Android.Support.V7.Widget.AppCompatTextView))
        {
            var textView            = (Android.Support.V7.Widget.AppCompatTextView)e.Child;
            var font                = Typeface.CreateFromAsset(this.Context.Assets, "gothambold.ttf");
            textView.Typeface       = font;
            toolbar.ChildViewAdded  -= Toolbar_ChildViewAdded;

            _textView = textView;


        }
    }



    protected override void SetupPageTransition(Android.Support.V4.App.FragmentTransaction transaction, bool isPush)
    {

        HandleTextFade();

        base.SetupPageTransition(transaction, isPush);
    }

    private void HandleTextFade()
    {

        if(_textView != null)
        {
            var colorAnim = ObjectAnimator.OfInt(_textView, "textColor", Android.Graphics.Color.White, Android.Graphics.Color.Transparent);
            colorAnim.SetEvaluator(new ArgbEvaluator());
            colorAnim.SetDuration(250);
            colorAnim.Start();

            colorAnim.AddListener(new OMNIAnimListener(_textView));
        }

    }

}

public class OMNIAnimListener : AnimatorListenerAdapter
{
    Android.Support.V7.Widget.AppCompatTextView TextView;

    public OMNIAnimListener(Android.Support.V7.Widget.AppCompatTextView textView)
        : base()
    {
        TextView = textView;
    }

    public override void OnAnimationEnd(Animator animation)
    {

        var colorAnim = ObjectAnimator.OfInt(TextView, "textColor", Android.Graphics.Color.Transparent, Android.Graphics.Color.White);
        colorAnim.SetEvaluator(new ArgbEvaluator());
        colorAnim.SetDuration(250);
        colorAnim.Start();

        base.OnAnimationEnd(animation);
    }
}

Calendar plugin

$
0
0

Hi xamarin forum
Is there any calendar plugin that can be used in xamarin forms and can easily pull data from database so that it can display birthdays records that comes from database?

I have tried the syncfusion calendar for xamarin forms but I think there is no way how to pull data from database and plot the data to the calendar

Thanks in advance


Is it possible to create an image from a view in Xamarin.Forms?

$
0
0

I have three images in a view one on top of the other. Together they create the image that I need. I need to create a image from this view. I have done this in Xamarin.Android and Xamarin.iOS, but I can't find a way to acomplish this in Xamarin.Forms. Is it possible and if yes - how can I do that?

How to remove title bar on xamarin wpf and make the application full screen.

$
0
0

Behavior of xamarin wpf full screen is different from original wpf application.
When i enable the full screen mode by ResizeMode="NoResize", WindowState="Normal", WindowStyle="None", Topmost="True", WindowState = "Maximized";
The application is not actually remove the titlebar and hide the taskbar.

Is there any way to achieve same behavior as native wpf application ?

How to show page number while scrolling a list in xamarin forms?

$
0
0

I have a listview with 2005 items,and it has a lazy loading.On itemAppearing I am loading 50 items at a time.I want to show a page number while user scroll up or scroll down depends on current items on the display.

Example: Listview loads 150 items(50 items each Lazy loading) when I am scrolling and reached to 130 index of listview.At this time I want to show the page number 3.Because 130 listview index is under 100-150.

how to implement this?

Xamarin Forms - Tabbed Pages reset

$
0
0

I have an app that has a few tabbed pages. When I navigate to these pages i have actions within each one that pushes additional content pages on to the stack. When I navigate away from that tabbed page to another tabbed page then return back to the initial tabbed page that "stack" of content pages are presented. Is there anways whenever I navigate from one tabbed page to another via the tab toolbar that it resets the stack. I cant figure out a way to pop off all the content pages I added and reset to the default one. This is for both droid and ios intances. Thanks

AutomationID Showing inconsistently

$
0
0

I have had this problem for some time. If I add AutomationID to, e.g., 5 controls on a page, and then run app.Repl(), I see one or two of the controls with their AutomationID but most without. Have you seen this, and do you have a solution or workaround?

Thanks!

Viewing all 77050 articles
Browse latest View live