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

iOS Map Memory Leaks

$
0
0

I'm running the latest version for Forms and iOS, and I am seeing VKMapView crashes occurring on iOS when navigating between pages with Map controls on them.

Anyone else seeing this behavior? If so, are there are any workarounds? I've included my crash log.

Thread 0 name: tid_303 Dispatch queue: com.apple.main-thread
Thread 0:
0 libc++.1.dylib 0x00000001833b7fcc std::1::__shared_weak_count::lock() + 4
1 VectorKit 0x0000000194096174 gss::StylesheetManager::clearCaches() + 88
2 VectorKit 0x0000000194091628 -[VKMapModel flushCaches:] + 140
3 VectorKit 0x000000019404a300 md::CartographicRenderer::prune(md::PruneLevel) + 44
4 VectorKit 0x0000000194055e00 -[VKMapView didReceiveMemoryWarning:] + 232
5 VectorKit 0x0000000194194d84 -[VKMemoryObserver triggerMemoryNotification:] + 116
6 VectorKit 0x0000000194194e30 __56-[VKMemoryObserver initWithTarget:selector:taskContext:]_block_invoke + 44
7 libdispatch.dylib 0x0000000183b36a14 _dispatch_client_callout + 12
8 libdispatch.dylib 0x0000000183b73640 _dispatch_continuation_pop$VARIANT$armv81 + 416
9 libdispatch.dylib 0x0000000183b7c858 _dispatch_source_invoke$VARIANT$armv81 + 524
10 libdispatch.dylib 0x0000000183b77b64 _dispatch_main_queue_callback_4CF$VARIANT$armv81 + 680
11 CoreFoundation 0x0000000184162544 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
+ 8
12 CoreFoundation 0x0000000184160120 __CFRunLoopRun + 2008
13 CoreFoundation 0x000000018407fe58 CFRunLoopRunSpecific + 432
14 GraphicsServices 0x0000000185f2cf84 GSEventRunModal + 96
15 UIKit 0x000000018d7d467c UIApplicationMain + 232


Using Visual Studio 2017, any coding error results in "The application is in break mode"

$
0
0

Take the following code:
var x = new List();
var y = x[3];

When debugging a UWP project, Visual Studio stops on the offending line and produces the expected error: "System.ArgumentOutOfRangeException: 'Index was out of range..."

Using the same solution, Android or iOS project, instead of breaking on the incorrect code, Visual Studio displays the "Break Mode" tab with "The application is in break mode". The Exception details only state "An unhandled exception occurred"

Anyone have any idea how to get Visual Studio to break on the offending line?

Is there a way to grayscale an image in Xamarin Forms?

$
0
0

You know how you can disable buttons and they have a disable color. Well lets say we have an image on a row that I also want to turn black and white depending on if that item is active or not. Is there anything available for this?

Android Form Keyboard Scroll

$
0
0

Hi guys,

I'm having a problem with a simple form. When an entry is clicked and the keyboard pops up, the toolbar just scrolls up and I can't scroll up to the next field. I am using the toolbar layout for Android and I'm suspecting that it might have something to do with this.

My structure:
Relative Layout -> Scrollview Layout -> Stacklayout -> bunch of entries

The axml Android Layout I'm using is the following:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />

Has anyone been experiencing the same problems?

Thanks
Shaun

Listview, custom cell and data binding

$
0
0

Hi all! After some research and after following some guides I have not yet managed to use a listview with a custom cell,
my problem is that when I fill the list with the model class the views are not initialized with the data.

my view class is

public class TrafficView : ViewCell
{
public static readonly BindableProperty ByteProperty = BindableProperty.Create("mbyte", typeof(string), typeof(TrafficView),"");
public static readonly BindableProperty ProgressProperty = BindableProperty.Create("progress", typeof(double), typeof(TrafficView), 0.0);
public static readonly BindableProperty CountryProperty = BindableProperty.Create("country", typeof(string), typeof(TrafficView), "");

    private static void mbytePropertyChanged(BindableObject bindable, object oldValue, object newValue)
    {
        //((TrafficView)bindable).Byte = newValue.ToString();
    }

    public string mbyte
    {
        get
        {
            return (string)GetValue(ByteProperty);
        }

        set
        {
            SetValue(ByteProperty, value);
            this.pBar.LabelStringFormat = value;
        }
    }

    public double progress
    {

        get
        {
            return (double)GetValue(ProgressProperty);
        }

        set
        {
            SetValue(ProgressProperty, value);
            this.pBar.Progress = value;
        }
    }

    public string country
    {

        get
        {
            return (string)GetValue(CountryProperty);
        }

        set
        {
            SetValue(CountryProperty, value);
            this.country.Text = value;
        }
    }

    public TrafficView()
    {
        initView();
    }


    public ProgressBarView pBar { get; set; }  
    public String total { get; set; } 
    public Label country { get; set; }

    private void initView()
    {
    .............................. some code ............................
        SetBinding(ByteProperty, new Binding("mbyte"));
    SetBinding(ProgressProperty, new Binding("progress"));
    SetBinding(CountryProperty, new Binding("country"));
        this.BindingContext = this;
    }

}

my model is

public class TrafficModel
{
public string country { get; set;}
public double progress { get; set;}
public string mbyte { get; set;}

    public TrafficModel(String mbyte,double progress,String country)
    {
        this.country = country;
        this.progress = progress;
        this.mbyte = mbyte;
    }

    public TrafficModel(){
        country = "";
        progress = 0;
        mbyte = "0";
    }
}

and my list view

    ListView soglieListView = new ListView();
        soglieListView.RowHeight = 140;
        soglieListView.SeparatorColor = Color.White;
        soglieListView.ItemTemplate = new DataTemplate(typeof(TrafficView));

        ObservableCollection<TrafficModel> trafficList = new ObservableCollection<TrafficModel>();
        for (int i = 0; i < soglie.Count;i++){
            trafficList.Add(new TrafficModel("Prova",3,"Prova"));
        }

        soglieListView.ItemsSource = trafficList;

what I did not understand?

Where is the build log?

$
0
0

When I'm running a Xamarin forms app via my iOS Emulator with Visual Studio on Windows, where specifically do I view the build log? Is it on my windows box or over on the mac mini that I have attached?

I'm getting an error that states: Native linking failed. Please review the build log

I'm not talking about the output window, but rather the build log they are referring to.

How to get Height and Width in UWP Custom Renderer Control

$
0
0

I have a UWP custom renderer that I am perform some drawing in the native control based on a UWP Canvas. I need the height and width of the Xamarin.Forms.View so that I can adjust my drawing accordingly. I have tried passing the Element height and width to the control but it always has a value of -1. In iOS renderer I send in the UIView.Bounds and in Android you pass the context and override OnDraw which has the Android Canvas which gives you this values. So does anyone know how to get the same values from UWP in the renderer? I have tried for hours to get the height and width of the View.

Orgbrat

Generating custom pins from using longitude and latitude values from a database.

$
0
0

Hi all, I'm currently working on a project in which I am using a custom map renderer with custom pins. I am using a firebase database to store the information. I was just wondering if there is a way to generate x amount of pins using the longitude and latitude values they have. I've been stuck on this for a while and cant seem to find the answer anywhere online.

Cheers!


PopAsync does not go back to pervious page

$
0
0

There are 3 pages in the navigation stack, a, b and c. When I use Navigation.PopAsync() inside c, c is removed from the stack but does not go back to the pervious page b.

I want to create a regular expressions

$
0
0

I want to create two regular expressions which is take the value between 0 to 90 only and other is 0 to -180 only & take 6 digit only after .(dot)

How to add image in navigation bar (Title bar) in xamarin.forms

$
0
0

Hi,

How to add image in navigation bar (Title bar) in xamarin.forms?

How to bind cell property to listview property

$
0
0

I have made a cell that has a checkbox. I would like the checkbox to only be visible when the listview is in edit mode.

`

        <ListView.ItemTemplate>
            <DataTemplate>
                <controls:CheckableCell x:Name="Checkable"
                                             Label="{Binding Source={x:Reference this}, Path=Content.Children[0].IsEditMode, StringFormat='{0}'}"
                                             Command="{Binding BindingContext.SwitchEditModeCommand, Source={x:Reference this}}"
                                             CommandParameter="{Binding .}"
                                             IsChecked="{Binding IsChecked, Mode=TwoWay}"
                                             EnableCheckbox="{Binding Source={x:Reference this}, Path=Content.Children[0].IsEditMode}">
                </controls:CheckableCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </controls:CustomListView>

`

In the XAML above, the label has an explicit path given and that does work. When I hit the command, the label does in fact switch from True to False. So I am certain the path is actually correct.

However, when I put the identical path in the binding for the EnableCheckbox property, I receive

"Position 56:50. Cannot assign property "EnableCheckbox": Property does not exists, or is not assignable, or mismatching type between value and property."

Here is the property definition for the CheckboxProperty in my custom CheckableCell:

public static BindableProperty EnableCheckboxeProperty = BindableProperty.Create(nameof(EnableCheckbox), typeof(bool), typeof(CheckableCell), false); public bool EnableCheckbox { get { return (bool)GetValue(EnableCheckboxeProperty); } set { SetValue(EnableCheckboxeProperty, value); } }
Please tell me what I am missing; I can't seem to figure out what's wrong with my code.

The type or namespace name 'Xamarin' could not be found

$
0
0

i've Created a xamarin Cross-platform solution (Blank) and it runs normally on android emulator whenever i try to run it on xamarin Live Player i get the below errors

1- AppDelegate.cs(1,1): error: The type or namespace name 'Xamarin' could not be found in the global namespace (are you missing an assembly reference?)
2- AppDelegate.cs(1,1): error: 'AppDelegate.FinishedLaunching(UIApplication, NSDictionary)': no suitable method found to override
3- AppDelegate.cs(1,1): error: The name 'LoadApplication' does not exist in the current context
4- AppDelegate.cs(1,1): error: The type or namespace name 'App' could not be found (are you missing a using directive or an assembly reference?)

i'm running VS 2017 ENT 15.5.6 on Windows 10 Pro. and everything is updated

Xamarin.Forms.DefaultItems.props not found

$
0
0

Hi,

So, I have been trying to fix this error I am getting over a month now, but with no success. I am currently working on a personal app project in collaboration with a few of my other developer friends and surprisingly the project compiles perfectly fine on my friends machine.

The following is the error I am getting:

"The imported project "C:\Users\divye\Documents\NHSF Xamarin App\packages\Xamarin.Forms.2.5.0.280555\build\netstandard1.0\Xamarin.Forms.DefaultItems.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk".

I can't understand why my code will not compile. I have gone through lots and lots of Stack Overflow posts and tried pretty much all the proposed solutions without any success. As a last resort I am having to post on here. I have also posted on Stack Overflow too.

I have tried the following:

  • Deleted the project locally from my machine and re-cloned the git repository and then tried running the project
  • Cleaned the project out and tried rebuilding again
  • Have spoken with my friend who is also working on the project, and matched my local project set out to his
  • I have gone into the Xamarin.iOS and Xamarin.Android .csproject files and also manually added in the Import statement for 'Xamarin.Forms.DefaultItems.props'
  • I have manually checked the folder '$..\netstandard1.0\ folder path to make sure the 'Xamarin.Forms.DefaultItems.props' file physically exists in the folder and it does for both iOS and Android.
  • Updated all packages in Xamarin Studio for the project to make sure latest versions of the packages are being used
  • Downgraded the Xamarin.Forms package to see if it could be to do with a bug in the latest package but this does not seem to be the issue.
  • A suggested fix that worked for my friend was recreating the project to contain the ASP.NET backend for mobile packages. I have tried this as well.
  • I was initially getting the error on my Mac so I thought I would give it a go on my Windows machine. Same thing happens on there too.

I am stumped at the issue. It is failing to build at all. Neither iOS or Android work.

I am hoping someone from here can help.

Thanks,

Divyesh!

I want to build a web view in ios xamarin

$
0
0

I finished the code and i tryed it with www.google.com and it worked but when i tried it with another link and it didn't work . the web page is not an secure website and i think the ios security doesn't let the xamarin te open it .
How can i fix these?


i have problem with creating a custom markup extension

$
0
0

i am trying to learn Xamarin by reading Ceating mobile apps with Xamarin Forms. Page 210 explain how to link Xamarin.FormsBook.Toolkit to CustomExtensionDemo project. I follow instructions(Include a link to the library project in your application solution, and add a reference to that library project in the common PCL project.) but Xamarin studio says FormsBook doesn not exist in the namespace. I have created Markup extension and CustomExtensionDemo project. there is also link in project. new Xamarin.FormsBook.Toolkit.HslColorExtension(); nevertheless it gives error message. i don't know how to reference to that library project in the common PCL project perhaps

Hints for 'InflateException' in XF app using an Android AXML for one activity

$
0
0

So I'm working on a Xamarin.Forms app.
While importing an vendor's SDK the make a separate Android Activity that inflates its own UI for a period of time. Kind of like when you click a [camera] button in an app, then another camera view is generated until you take the picture, then goes away returning you to your app.

The vendor sample app works. When importing their elements to my project the same Activity and AXML crashes with an Android Inflate Exception.
Clearly I'm missing some part, reference, or XML style reference. But that exception give no hint, no idea, nothing helpful like "style blahblah could not be found" or "element with @+id/buttonimage" could not be found" etc.

Does anyone know a way to get some more info out of the android side of the app during run-time debugging? This vague message is not helpful at all.

Xamarin Forms Map - How to know when the map is full loaded and displayed?

$
0
0

Hi,

I really need to know when the map is either full loaded or displayed but I cannot find anything anything about it, why?

Do you have any idea about an event or something like that?

Thank for any help !

Xamarin Forms UWP - MapIcon/Pins size

$
0
0

My question cannot be more easy:

How can I change the size or resize my pins about the zoom?

This is for a CustomPinRenderer of my UWP part. (PCL project)

Scrolling Grid Relative Sizes

$
0
0

I have managed to create a GridView inside a ScrollView that uses 8 rows of row height 250 (Absolute). This was fine until I realised it would not work on screens with different resolutions. How can I create a grid view where there are 8 rows, but each row takes up half the screen so you have to scroll down to see the rest? Using 8 rows of height "*" just puts 8 rows onto the view with no scrolling. I am using xaml but can use c# if necessary.

Viewing all 58056 articles
Browse latest View live


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