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

sqlite works on emulator but crashes on device.

$
0
0

I'm trying to work with database locally
https://developer.xamarin.com/guides/xamarin-forms/working-with/databases/

I've downloaded sqlite-net-pcl frpm nuget, here is my code

in PLC

//ItqanDatabase.cs
namespace itqan.Classes
{
    public class ItqanDatabase
    {
        readonly SQLiteAsyncConnection database;

        public ItqanDatabase(string dbPath)
        {
            database = new SQLiteAsyncConnection(dbPath);
        }
    }
}

//IFileHelper.cs
namespace itqan
{
    public interface IFileHelper
    {
        string GetLocalFilePath(string filename);
    }
}

//App.cs
public class App : Application
{
    static ItqanDatabase database;

    public static ItqanDatabase Database
    {
        get
        {
            if (database == null)
            {
                database = new ItqanDatabase(DependencyService.Get<IFileHelper>().GetLocalFilePath("itqan.db3"));
            }
            return database;
        }
    }

in droid project

[assembly: Dependency(typeof(FileHelper))]
namespace itqan.Droid
{
    class FileHelper : IFileHelper
    {
        public string GetLocalFilePath(string filename)
        {
            string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            return Path.Combine(path, filename);
        }
    }
}

This code works perfectly on emulator, but when I run the code on my Android 5.1 tablet It crashes immediately.

What is the problem? and how can I solve it?


Binding to ListView using MVVM pattern

$
0
0

I am wanting to bind a list of contacts to the view.

Contacts.xaml looks like this:

<ListView x:Name="ContactsListView">
    <ListView.ItemTemplate>
      <DataTemplate>
        <TextCell Text="{Binding DisplayName}" />
      </DataTemplate>
    </ListView.ItemTemplate>
  </ListView>

Contacts.xaml.cs:

public partial class ContactsPage : ContentPage
    {
        public ContactsPage()
        {
            InitializeComponent();
            BindingContext = new ContactViewModel();
        }
    }

In my View Model (ContactViewModel.cs), how do I bind the list of contacts in there to the the xaml ListView?

Thanks for any help.

Listview in mvvm

$
0
0

hiii....how to do itemtapped event in listview using mvvm.

How to data bind in xaml

$
0
0

Hi

I've tried to test out PCL with XAML file that should share UI for cross-platform..

The problem is i dont know how to the data properly.

public class Employee
    {
        public string DisplayName { get; set; }
    }

public partial class EmployeeListPage : ContentPage
    {
        public ObservableCollection<Employee> employees = new ObservableCollection<Employee>();
        public EmployeeListPage()
        {
            employees.Add(new Employee { DisplayName = "Rob Finnerty" });
            employees.Add(new Employee { DisplayName = "Bill Wrestler" });
            employees.Add(new Employee { DisplayName = "Dr. Geri-Beth Hooper" });
            employees.Add(new Employee { DisplayName = "Dr. Keith Joyce-Purdy" });
            employees.Add(new Employee { DisplayName = "Sheri Spruce" });
            employees.Add(new Employee { DisplayName = "Burt Indybrick" });
        }
    }

Name of XAML file is Page1.
`

    <ListView ItemSource="{Binding employees}" x:Name="emView">
      <ListView.ItemTemplate>
        <DataTemplate>
          <TextCell Text="{Binding DisplayName}" />
        </DataTemplate>
      </ListView.ItemTemplate>
    </ListView>`

For make it run and show the list i did this in the Page1.xaml.cs and deleting "ItemSoruce="{Binding employees}"

public Page1()
        {
            InitializeComponent();
             var test = new EmployeeListPage();
            emView.ItemsSource = test.employees;
        }
    }

Databinding to a command inside a DataTemplate

$
0
0

Hi there, I'm just having a play with Xamarin Forms and databinding and am having a problem working out the syntax. Say I've got a view model associated with some XAML. Inside the view model I've got a class Foo

    class Foo
    {
            public string Name {get; set;}
            public string Details {get; set;}
    }

I've also got a command

    public ICommand DoSomethingCommand { protected set; get; }

and an observable collection of Foos

    private ObservableCollection<Foo> _foos = new ObservableCollection<Foo>();
    public ObservableCollection<Foo> Foos
            {
                get { return _foos; }
            }

In my XAML, I've got a ListView. The binding to each field of my Foo works fine. However, I want to bind a command to each row, so that I can do something when the user taps on the row. The binding doesn't work though, presumably because the command isn't inside the Foo object? I've done some checking online and people suggest using RelativeSource to get to the command object but this doesn't work (I get a runtime xaml parse error). Anyone got any solution to this?

<ListView x:Name="FooView" ItemsSource="{Binding Foos}">
    <ListView.ItemTemplate>
      <DataTemplate>

                    <TextCell Text="{Binding Name}" Detail="{Binding Details}" Command="{Binding DoSomethingCommand}" />

      </DataTemplate>
    </ListView.ItemTemplate>
  </ListView>

MVVM Binding Issues

$
0
0

Hello all,

I am having difficulty with the data bindings with xamarin and I was hoping someone might be able to see what I am doing wrong.

First created this in my resources

        <DataTemplate x:Key="tileTemplate">
            <Grid x:Name="gridTile" WidthRequest="90" HeightRequest="90" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" BackgroundColor="Aqua">
                <StackLayout>
                    <Grid BackgroundColor="{Binding Color}">
                        <!---<Image Source="{Binding Image}" IsVisible="{Binding IsVisible}" Height="70" Width="70" HorizontalOptions="Center"/>-->
                    </Grid>
                    <Grid HeightRequest="20" WidthRequest="90">
                        <StackLayout IsVisible="{Binding IsVisible}" BackgroundColor="Gray">
                            <TextCell Text="{Binding Text}" HeightRequest="20" TextColor="White" HorizontalOptions="CenterAndExpand"/>
                        </StackLayout>
                    </Grid>
                </StackLayout>
            </Grid>
        </DataTemplate>

In the constructor I have this.BindingContext = new TileBoardViewModel (); and in the same view as above I added

(using the gridview class from the xlab package)

        <controls:GridView
                x:Name="TileBoard"
                HeightRequest="90"
                HorizontalOptions="CenterAndExpand"
                VerticalOptions="Center"
                ItemsSource="{Binding TileTimes}"
                ItemTemplate="{StaticResource tileTemplate}"/>

My observable collection of tiles gets populated but it doesn't show up in my view :(.

Is there something that I am missing or not getting?

Thanks for any help!!

Get the selected item in a list view button

$
0
0

I am trying to get the selected item in the tap event of a button in a list view item, but I can't seem to figure it out. Anyone know how to accomplish this?

Calling Command From ViewModel Using Button Within ListView

$
0
0

I've made a custom ViewCell with a button in it to delete the row of the ListView. It has a Clicked method that obtains the item from the ListView that I want to delete but I can't work out how to call the Delete Command I've made in my ViewModel. How do I go about joining the pieces I have together? I'm pretty new to Xamarin so I fear I'm missing something obvious.

I've put the relevant bits of code from the three classes below, including the ContentPage with the ListView itself.

    public class PlaceListCell : ViewCell
        {
            public PlaceListCell ()
            {
                var deleteButton = new Button {
                    Text = "Delete"
                };
                deleteButton.SetBinding (Button.CommandParameterProperty, new Binding ("."));
                deleteButton.Clicked += (sender, e) =>
                {
                    var b = (Button) sender;
                    var item = (Place) b.CommandParameter;

                };

            }
        }

        public class PlaceRankPage : ContentPage
        {
            PlaceRankVM _vm {
                get { return BindingContext as PlaceRankVM; }
            }

            public PlaceRankPage ()
            {
                var placeList = new ListView {
                    ItemTemplate = placeTemplate
                };
                placeList.SetBinding (ListView.ItemsSourceProperty, "Places");

                placeList.ItemTapped += async (sender, e) => {
                    var item = (Place) e.Item;
                    _vm.ViewCommand.Execute (item);
                    placeList.SelectedItem = null;
                };
            }
        }

        public class PlaceRankVM : ViewModel
        {
            ObservableCollection<Place> _places;
            public ObservableCollection<Place> Places
            {
                get { return _places; }
                set {
                    _places = value;
                    OnPropertyChanged ();
                }
            }

            Command<Place> _deleteCommand;
            public Command<Place> DeleteCommand {
                get { return _deleteCommand
                    ?? (_deleteCommand = new Command<Place> (async (place) => await
                        ExecuteDeleteCommand (place)));
                }
            }

            async Task ExecuteDeleteCommand(Place place)
            {
                Places.Remove (place);
            }
        }

Estimote SDK for Android , does it work for you ?

$
0
0

Hello guys, i wonder if any of you have managed to make an estimote app that can detect beacons on android/ forms . I have tried using the Xamarin Estimote SDK for android, but never managed to go beyond the ready state for the manager. Did anyone succeed to get some results ?

Show registration screen only once after the app downloaded

$
0
0

Hi,
In my app I want that when the user download the app show registration **screen once and never again, when the registration completes show **Login screen and from the next time the user open the app show Login screen. How can I achieve this?

Can someone please explain project types and their dependencies and nuget?

$
0
0

Over the years, I have never figured out how different project types work, which ones can be used as a reference in other, and which nuget profiles can be used by which.

I find a nuget package and try to add it to my Xamarin project and it says it cannot be added to a project with target platform of Xamarin.iOS (or something like that). I then say, ok, skip the nuget package. I will build the project from source and then just reference the project as a dependency in its references. But then Xamarin Studio says that project type is not compatible with my Xamarin.iOS project.

How can I get a handle on this? How can I know what to change the target framework on the project I built from source so that it can be added as a reference to Xamarin projects? There has to be documentation somewhere, but I just can't find it.

Sharing and receiving documents between apps with Xamarin Forms

$
0
0

⁠⁠⁠Hello,

I need to send and receive a pdf document or image in an application with Xamarin Forms, using the share documents between applications feature.

I have seen that there is a plugin named "Share Plugin", but it only allows text sharing, I cannot send or receive any document.

To sum up, I would need two things:
1. Share a document with another application.
2. Register my application so it appears in the application selection dialog when I want to share a document.

Both with Xamarin Forms.

Is that possible?

⁠⁠⁠Thank you.

Regards.

Xamarin 4 inch screen displaying on testflight but on the app store it displays in letterbox effect

$
0
0

Good Day

xamarin.forms.ios

I have a problem that when I test my app on testflight the screen displays properly but when I download it on the app store it displays in a letterbox effect.

I have got a 4 inch launch image in the project. Is it possible to point me to any other settings that needs to be specified for it to display properly when installed from the appstore

Regards

Access device camera from HybridWebView

$
0
0

Hi
I render some HTML content using the HybridWebView and would like to access device camera when user clicks a button on the page. I have tried to google around for answers but could find anything. Has anybody got a solution as to how I can access the device camera?

Note I am developing using Xamarin Forms.

Project won't build: Xamarin.Android.Support

$
0
0

When creating a blank app (Xamarin.Forms Portable) using VS2015, when I attempt to build the project, the compiler complains about Xamarin.Android.Support repository r22.zip not being able to download, and to manually place it in my Android.Support.Design folder. I have tried following other topics on this form and stackoverflow, but to no avail. The project refuses to build.

When I attempt to install the packages off the nuget manager, I get an error that 23.0.1 doesn't support package111.

I have installed every single package available off the Android SDK Manager, and have tried setting the compiler to use the latest version of Android.

Any help would be appreciated. Thank you.

Severity    Code    Description Project File    Line
Error       Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3 directory. XamarinFormsExample.Droid
Error       Reason: One or more errors occurred.    XamarinFormsExample.Droid
Error       Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3 directory. XamarinFormsExample.Droid
Error       Reason: One or more errors occurred.    XamarinFormsExample.Droid
Error       Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3 directory. XamarinFormsExample.Droid
Error       Reason: One or more errors occurred.    XamarinFormsExample.Droid
Error       Please install package: 'Xamarin.Android.Support.v4' available in SDK installer. Java library file C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3\embedded\classes.jar doesn't exist.  XamarinFormsExample.Droid
Error       Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3 directory. XamarinFormsExample.Droid
Error       Reason: One or more errors occurred.    XamarinFormsExample.Droid
Error       Please install package: 'Xamarin.Android.Support.v4' available in SDK installer. Java library file C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3\embedded\libs/internal_impl-23.0.1.jar doesn't exist.    XamarinFormsExample.Droid
Error       Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3 directory. XamarinFormsExample.Droid
Error       Reason: One or more errors occurred.    XamarinFormsExample.Droid
Error       Please install package: 'Xamarin.Android.Support.v4' available in SDK installer. Android resource directory C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3\embedded\./ doesn't exist.  XamarinFormsExample.Droid
Error       Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.AppCompat\23.0.1.3 directory.   XamarinFormsExample.Droid
Error       Reason: One or more errors occurred.    XamarinFormsExample.Droid
Error       Please install package: 'Xamarin.Android.Support.v7.AppCompat' available in SDK installer. Java library file C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.AppCompat\23.0.1.3\embedded\classes.jar doesn't exist.  XamarinFormsExample.Droid
Error       Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.AppCompat\23.0.1.3 directory.   XamarinFormsExample.Droid
Error       Reason: One or more errors occurred.    XamarinFormsExample.Droid
Error       Please install package: 'Xamarin.Android.Support.v7.AppCompat' available in SDK installer. Android resource directory C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.AppCompat\23.0.1.3\embedded\./ doesn't exist.  XamarinFormsExample.Droid
Error       Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.CardView\23.0.1.3 directory.    XamarinFormsExample.Droid
Error       Reason: One or more errors occurred.    XamarinFormsExample.Droid
Error       Please install package: 'Xamarin.Android.Support.v7.CardView' available in SDK installer. Java library file C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.CardView\23.0.1.3\embedded\classes.jar doesn't exist.    XamarinFormsExample.Droid
Error       Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.CardView\23.0.1.3 directory.    XamarinFormsExample.Droid
Error       Reason: One or more errors occurred.    XamarinFormsExample.Droid
Error       Please install package: 'Xamarin.Android.Support.v7.CardView' available in SDK installer. Android resource directory C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.CardView\23.0.1.3\embedded\./ doesn't exist.    XamarinFormsExample.Droid
Error       Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3 directory. XamarinFormsExample.Droid
Error       Reason: One or more errors occurred.    XamarinFormsExample.Droid
Error       Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Java library file C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3\embedded\classes.jar doesn't exist.  XamarinFormsExample.Droid
Error       Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3 directory. XamarinFormsExample.Droid
Error       Reason: One or more errors occurred.    XamarinFormsExample.Droid
Error       Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Java library file C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3\embedded\libs/internal_impl-23.0.1.jar doesn't exist.    XamarinFormsExample.Droid
Error       Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3 directory. XamarinFormsExample.Droid
Error       Reason: One or more errors occurred.    XamarinFormsExample.Droid
Error       Please install package: 'Xamarin.Android.Support.v7.MediaRouter' available in SDK installer. Android resource directory C:\Users\warrenbr\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3\embedded\./ doesn't exist.  XamarinFormsExample.Droid

Xamarin.iOS.Common.targets(431,3): error : One or more errors occurred.

$
0
0

Using:

  • Visual Studio 2015 (14.0.25431.01 Update 3)
  • Xamarin forms v2.3.3.175

Getting this error while trying to deploy iOS, build is okay:

2>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(431,3): error : One or more errors occurred.
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

I am not using any story boards (xref -> https://forums.xamarin.com/discussion/62877/blank-error-when-building-blank-ios-project-with-xamarin-visual-studio-2015)

Trying to back out from last changes now.

Does anyone have any ideas?

MasterDe

$
0
0

Hi Everyone,

I am fairly new to xamarin and i have a problem with navigating between MasterDetailPages

The way my app work is that after the user logs in the user will be sent to one of the MasterDetailPages but the user is allowed to navigate to other MasterDetailPages from the MenuPage which is set to the Master for all MasterDetailPage.

The problem is that the app works fine if the clicks are done slowly with time inbetween and on a sluggy emulator but on an actual device it crashes when i double click without any exception and leaves me a stacktrace of ...

11-22 13:00:23.672 E/mono-rt ( 5477): Stacktrace:
11-22 13:00:23.672 E/mono-rt ( 5477):
11-22 13:00:23.672 E/mono-rt ( 5477): at <0xffffffff>
11-22 13:00:23.672 E/mono-rt ( 5477): at (wrapper managed-to-native) Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a (intptr,intptr&,intptr,intptr,intptr,Java.Interop.JniArgumentValue) <0x0005b>
11-22 13:00:23.672 E/mono-rt ( 5477): at Java.Interop.JniEnvironment/InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference,Java.Interop.JniObjectReference,Java.Interop.JniMethodInfo,Java.Interop.JniArgumentValue
)
11-22 13:00:23.672 E/mono-rt ( 5477): at Java.Interop.JniPeerMembers/JniInstanceMethods.InvokeVirtualVoidMethod (string,Java.Interop.IJavaPeerable,Java.Interop.JniArgumentValue*)
11-22 13:00:23.672 E/mono-rt ( 5477): at Android.Views.ViewGroup.AddView (Android.Views.View)
11-22 13:00:23.672 E/mono-rt ( 5477): at Xamarin.Forms.Platform.Android.Platform.AddChild (Xamarin.Forms.VisualElement,bool) [0x00034] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\ImageRenderer.cs:43
11-22 13:00:23.672 E/mono-rt ( 5477): at Xamarin.Forms.Platform.Android.Platform.SetPage (Xamarin.Forms.Page) [0x0001d] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\FrameRenderer.cs:31
11-22 13:00:23.672 E/mono-rt ( 5477): at Xamarin.Forms.Platform.Android.FormsApplicationActivity.InternalSetPage (Xamarin.Forms.Page) [0x0001d] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Cells\TextCellRenderer.cs:56
11-22 13:00:23.672 E/mono-rt ( 5477): at Xamarin.Forms.Platform.Android.FormsApplicationActivity.AppOnPropertyChanged (object,System.ComponentModel.PropertyChangedEventArgs) [0x00016] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Cells\TextCellRenderer.cs:50
11-22 13:00:23.672 E/mono-rt ( 5477): at Xamarin.Forms.BindableObject.OnPropertyChanged (string) [0x0000a] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Core\BindableObject.cs:137
11-22 13:00:23.672 E/mono-rt ( 5477): at Xamarin.Forms.Element.OnPropertyChanged (string) [0x00000] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Core\Element.cs:369
11-22 13:00:23.672 E/mono-rt ( 5477): at Xamarin.Forms.Application.set_MainPage (Xamarin.Forms.Page) [0x0008b] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Core\Application.cs:88
11-22 13:00:23.672 E/mono-rt ( 5477): at MyApp.MenuPage.openPage (string,Xamarin.Forms.StackLayout) [0x00011] in C:\Users\kenneth.lee\Documents\my-app\MyApp\MainMenu\MenuPage.cs:39
11-22 13:00:23.672 E/mono-rt ( 5477): at MyApp.MenuPage/<>c__DisplayClass5_0.<.ctor>b__5 () [0x00000] in C:\Users\kenneth.lee\Documents\my-app\MyApp\MainMenu\MenuPage.cs:223
11-22 13:00:23.672 E/mono-rt ( 5477): at Xamarin.Forms.Command/<>c__DisplayClass3_0.<.ctor>b__0 (object) [0x00000] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Core\Command.cs:36
11-22 13:00:23.672 E/mono-rt ( 5477): at Xamarin.Forms.Command.Execute (object) [0x00000] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Core\Command.cs:70
11-22 13:00:23.672 E/mono-rt ( 5477): at Xamarin.Forms.TapGestureRecognizer.SendTapped (Xamarin.Forms.View) [0x00018] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Core\TapGestureRecognizer.cs:42
11-22 13:00:23.672 E/mono-rt ( 5477): at Xamarin.Forms.Platform.Android.TapGestureHandler.OnTap (int) [0x00000] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\RendererFactory.cs:10
11-22 13:00:23.672 E/mono-rt ( 5477): at Xamarin.Forms.Platform.Android.InnerGestureListener.Android.Views.GestureDetector.IOnGestureListener.OnSingleTapUp (Android.Views.MotionEvent) [0x00008] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\FormsTextView.cs:27
11-22 13:00:23.672 E/mono-rt ( 5477): at Android.Views.GestureDetector/IOnGestureListenerInvoker.n_OnSingleTapUp_Landroid_view_MotionEvent_ (intptr,intptr,intptr)
11-22 13:00:23.672 E/mono-rt ( 5477): at (wrapper dynamic-method) object.c849caa1-493e-456f-b187-76859bdd1cc4 (intptr,intptr,intptr)
11-22 13:00:23.672 E/mono-rt ( 5477): at (wrapper native-to-managed) object.c849caa1-493e-456f-b187-76859bdd1cc4 (intptr,intptr,intptr)

The function at line 39 of MenuPage is

    void openPage(string sender, StackLayout item)
    {
            App.Current.MainPage = new LandingPage(sender);
            Navigation.RemovePage(this);
    }

LandingPage Class helps decide which MasterPageDetail to create based off the sender string.

I don't have any clue how to fix this and have tried to implement work around this issue like trying to wait for the first click to finish.
If any more details are needed I would be happy to provide.
Thanks!

How to bind a Command to ListView.ItemTapped

$
0
0

Hi,

I did quite some googling now but did not find an answer. How do I bind a Command to the ItemTapped event of a ListView in Xaml?

Best
Thomas

TabbedPage Error when Icon is set.

$
0
0

Hello,
When Icon property is set for a tabbedpage like:

it gets an error:

System.Exception: Could not initialize an instance of the type 'UIKit.UIImage': the native 'initWithContentsOfFile:' method returned nil.

It is possible to ignore this condition by setting MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure to false.

....

already checked if icons were in the Resources folder inside ios project with properties to BundledResources but still getting the same error.

Do I missing something?
Regards,
Jun

Webview width set to device width?

$
0
0

I have a page with a Horizontal ScrollView that has several WebView side by side.
I would like each WebView to occupy the full width of the device.
How can I achieve this?

I tried setting RequiredWidth to the screen width (Acr.DeviceInfo.DeviceInfo.Hardware.ScreenWidth).
It works on iPhone 5c, but doesn't show up properly on Android MotoG (WebView actual size is twice the ScreenWidth).

Any ideas how to get this to work?

Viewing all 91519 articles
Browse latest View live


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