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

How to change background color of selected item in a listview on xamarin form?

$
0
0

Hello,

I have ListView like this

     <StackLayout Spacing="0">
        <ListView x:Name="lvMenu" SeparatorColor="Green">
          <ListView.ItemTemplate>
            <DataTemplate>
              <ViewCell>
                <StackLayout Padding="10">
                  <Label HorizontalOptions="FillAndExpand" VerticalOptions="Center" Text="{Binding Title}" TextColor="#03a9f4" />
                </StackLayout>
              </ViewCell>
            </DataTemplate>
          </ListView.ItemTemplate>
        </ListView>
      </StackLayout>

Also have ItemSelected event handler like this

    lvMenu.ItemSelected += GotoPage;
    private void GotoPage(object sender, SelectedItemChangedEventArgs e)
    {
        var item = e.SelectedItem as MasterPageItem;
        if (item != null)
        {
            //Change bg
            if (item.Title == "Logout")
            {
                LogoutUser();
            }
            else
            {
                NavigationPage nPage = new NavigationPage((Page)Activator.CreateInstance(item.TargetType)) {
                    Title = item.Title
                };
                this.Detail = nPage;
                this.IsPresented = false;
            }
        }
    }
    public class MasterPageItem
    {
        public string Title { get; set; }
        public Type TargetType { get; set; }
    }

Can anyone suggest how to change the selected item's default background color?


Characters not recognized when reading from embedded txt

$
0
0

Hi everyone.
I want to include a very long text (a book) on my app, and for that I am using a .txt as an embedded resource. I am using this code to do it:

var assembly = IntrospectionExtensions.GetTypeInfo(typeof(Contenido)).Assembly;
Stream stream = assembly.GetManifestResourceStream("RetornoApp.Retorno.txt");

string contenido = "";
using (var reader = new StreamReader(stream))
{
contenido = reader.ReadToEnd();
}

Label label = new Label() { Text = contenido};

It's working almost fine. The problem is that the characters such as áéíóú are not being written correctly, and a � is being displayed instead. It is a book in spanish so it's not a small problem since these characters are frequent.
I am guessing it's beacuse I am using a stream?

Thanks!!!

Problem with XAML x:Name and access from code-behind

$
0
0

Hi all.

I'm new to Xamarin Forms and have made a Xamarin Forms PCL project and added a few pages to it. So far the app is compiling and running fine on my samsung galaxy s5. :D But when a make a new Entry tag in the xaml file and give it a x:Name so that i can access it from code-behind, i can't, i need to restart Xamarin Studio to access it and se all the methods and properties is has. I have tried to search google for a similar problem, but with no luck.
So my question is, does someone know how to solve this problem? As far as i know, it has something to do with a g.cs file no being generated.

My system is a Macbook Air fully updated, and with Xamarin Studio 5.5, and i have a indie license for android.

Kind regards
Steffen

Tabbed Page tab reselected

$
0
0

I've been looking for a solution to this problem for a few days and I think I've exhausted all of the old posts and articles on the topic without finding a solution. For Android specifically I've tried a custom renderer that uses TabLayout.IOnTabSelectedListener.OnTabReselected but it seems the event is never fired or even referenced anywhere.

How do you detect when a tab is reselected on a tabbed page? By reselected I mean the button of the tabbed page tab you are currently on is pressed while you are still on that tab. I need this in order to do a page "refresh". Thanks in advance!

Update only 1 label in listview

$
0
0

I fill a listview from a Firebase database.

   var allPupillen = await firebaseHelper.GetAllPupillen();
            lstBal.ItemsSource = allPupillen;

No problem there , but is it possible to update only 1 label ?

This label binding to "Adres"

   <Label Grid.Row="0"
                           Grid.Column="1"
                               HorizontalOptions="Center"    
                           Text="{Binding Adres}"
                                    TextColor="#302C2C"
                           VerticalOptions="Center" />

And this in Firebasehelper

 public async Task<List<Pupillen>> GetAllPupillen()
    {

        return (await firebase
          .Child("Pupil")
          .OnceAsync<Pupillen>()).Select(item => new Pupillen
          {
              BalId = item.Object.BalId,
              Adres = item.Object.Adres,
              Postcode = item.Object.Postcode,
              Telefoon = item.Object.Telefoon,
              Plaats = item.Object.Plaats,
              Tegenstander = item.Object.Tegenstander,
              Maps = item.Object.Maps,
              Hobby = item.Object.Hobby,
               Verhaaltje = item.Object.Verhaaltje,
              Team1 = item.Object.Team1,
              Team2 = item.Object.Team2,
              Team3 = item.Object.Team3,
              Status = item.Object.Status,
              Voetbal = item.Object.Voetbal,
              Grade = item.Object.Grade,
              Club = item.Object.Club,
              Hobbykompleet = item.Object.Hobbykompleet,
              Favclubkompleet = item.Object.Favclubkompleet,
              Favspelerkompleet = item.Object.Favspelerkompleet,
              Leeftijdkompleet = item.Object.Leeftijdkompleet,
              Naamkompleet = item.Object.Naamkompleet,
              Teamkompleet = item.Object.Teamkompleet


          }).ToList();
    }
    public async Task<Pupillen> Pupillen(int BalId)
    {
        var allPupillen = await GetAllPupillen();
        await firebase
          .Child("Pupillen")
          .OnceAsync<Pupillen>();
        return allPupillen.Where(a => a.BalId == BalId).FirstOrDefault();
    }

    public async Task AddPupillen(int v, string Plaats)
    {


        await firebase
          .Child("Pupil")

         .PostAsync(new Adresclub() { Plaats = "Ji" });


    }

Buzzer App over the wifi between two device. Any example on the web?

$
0
0

Buzzer App over the wifi between two device. One device will have a button, once pressed the other device will make a sound.
Any example on the web?

Is there examples where xamarin can be a web service ? Where it cen accept rest requests?

How to update or delete a collection View

$
0
0

I am using Observable Collection to populate a Collection View for the list of users. I also wrapped Swipe_Item inside collection view to perform Update or delete an entry from the collection. But I am not able to achieve this since I am a beginner in Xamrin.forms. Below is the code snippet.

Please let me know how to get the SwippedItem from the Collection View

XAML:
<?xml version="1.0" encoding="utf-8" ?>



<CollectionView.ItemTemplate>


<SwipeView.LeftItems>




</SwipeView.LeftItems>

                    <Grid Padding="10">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="50" />
                            <RowDefinition Height="50" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100" />
                            <ColumnDefinition Width="100" />
                        </Grid.ColumnDefinitions>
                        <Image Grid.RowSpan="2" 
                           Source="https://sevencloudstorage.blob.core.windows.net/sevenimages/Photo1.jpg" 
                           Aspect="Fill"
                           HeightRequest="50" 
                           WidthRequest="50" />
                        <Label x:Name="userName" Grid.Column="1" 
                           Text="{Binding UserName}" 
                           FontAttributes="Bold"
                           LineBreakMode="TailTruncation" />
                        <Label Grid.Column="2" 
                           Text="{Binding RoleName}" 
                           FontAttributes="Bold"
                           LineBreakMode="TailTruncation" x:Name="roleName" />
                        <Label Grid.Row="1"
                           Grid.Column="1" 
                           Text="{Binding PhoneNumber}"
                           LineBreakMode="TailTruncation"
                           FontAttributes="Italic" x:Name="phoneNumber"                                   
                            />
                    </Grid>
                </SwipeView>
            </DataTemplate>
        </CollectionView.ItemTemplate>
    </CollectionView>
    <Button Text="Add User" BackgroundColor="#25A6D9" TextColor="#D7D9C7" x:Name="btn1" IsEnabled="False"/>
</StackLayout>

CodeBehind
using SevenDashboard.Models;
using SevenDashboard.ViewModels;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

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

namespace SevenDashboard
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class UserManagementPage : ContentPage
{

    public UserManagementPage()
    {
        InitializeComponent();

        BindingContext = new UserViewModel();



    }
    public void SwipeItem_Update_Invoked(ObservableCollection<UserManagement> collection, UserManagement instance)
    {
        btn1.IsEnabled = false;
        var userDet = collectionView.SelectedItem as UserManagement;
        string username = userDet.UserName.ToString();
        Navigation.PushAsync(new UserUpdate(username));
    }
    public void SwipeItem_Delete_Invoked(object sender, EventArgs e)
    {
        btn1.IsEnabled = false;

    }
}

}

How to insert badge in botttom tab on shell page?

$
0
0

I searched alot on internet but found no solution..Badge can be easily inserted in tabbed page but i am using Shell page..Anyone have code how to show badge in bottom tab in shell page?


image edge detection and creating masks.

$
0
0

Hello everyone, I hope there is a simple solution for this issue I am having...

I have an app where I need to take a picture with the device camera, then process it as line art, detecting the edges and shapes. I then need to create custom fills for those shapes that can be overlaid and displayed. In the earlier version will be simple hand drawn geometric shapes and polygons, but in future revisions I will want to be able to take images, detect their edges and general shapes then overlay my own samples and images as "fills"

I've been looking at OpenCV, but it seems to only have a C++, Java, and Python api. I used to write C++ and could figure it out again but it would be nice to keep the whole project in C# if possible. I have not written Java and would prefer not to tackle a new project and language at the same time as well.

Are there any good API's and Examples out there for how to detect lineart shapes?

I am effectively trying to take a hand drawn b&w image and turn it into a vector image.

Thanks!

Older versions of android don't load an app

$
0
0

Good day,

i was hoping someone could help me, i'm pretty new to Xamarin.
my app works perfectly on newer devices android 9 and 10 but older devices it doesn't seem to work at all.

LG stylus 3 - android 7.0: The app loads and works okayish the first time, after the first load none of the images display (This includes ImageButtons)
Sony Xperia - android 5.0: The app wont load at all just crashes, crashes instantly within 3 seconds.

I have tried to load demo apps to both devices with the same result.

Need to kill and restart application after changing Android language

$
0
0

Hi,

In my Xamarin forms android application I have support of localization language e.g French. Now, when I launch my application and then go to Settings of Android phone and change current language to French, and switch back to my application it doesn't adapt to language change. It just displays white screen. I need to kill my application and again restart to reflect my application in French. Any idea on how to adapt to language change while application is already running.

Any help is appreciated.

Thanks.

How to use TextView.SetAutoSizeTextTypeUniformWithConfiguration on Android 6.0.1?

$
0
0

In a custom renderer and in an effect, both on Android, I make use of TextView.SetAutoSizeTextTypeUniformWithConfiguration

On a Samsung Galaxy J5 running Android 6.0.1 this is resulting in a Java.Lang.NoSuchMethodError exception.

I believe that TextView.SetAutoSizeTextTypeUniformWithConfiguration was introduced in Oreo. However, according to https://android.jlelse.eu/auto-sizing-textviews-in-android-d615ee2dc794 , using the V26 (and I assume any later) support libraries should add support for TextView.SetAutoSizeTextTypeUniformWithConfiguration in Android 4.0 and later (I am interpreting the wording on that page, as the English is a little dodgy).

Exactly what is says is:

First, you have to add the support library v26 or more in your build.gradle file.
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
Although, it has been introduced in Android Oreo, but through using support library, this feature is backward compatible upto the Android 4.0 and later.

In my Xamarin.Forms app, I add the following NuGets:
Xamarin.Android.Support.Compat 28.0.0.3
Xamarin.Android.Support.Media.Compat 28.0.0.3
Xamarin.Android.Support.v7.AppCompat 28.0.0.3

but still it reports Java.Lang.NoSuchMethodError on Android 6.0.1.

What else do I need to do to get that method supported?

navigation to root after closing dialog Prism xamarin

$
0
0

Hi all,
I'm using IDialogService to show Dialog. When I click cancel, I want to navigate back to the root page and not to the page that it's displayed on.
so I did the following:
public DetectedCorrectlyDialogViewModel(IDialogService dialogService,INavigationService navigationService)
{
_dialogService = dialogService;
_navigationService = navigationService;
NameFieldCommand = new DelegateCommand(NavigateToAddFieldDialog);
BackCommand = new DelegateCommand(Back);
}
private void Back()
{
RequestClose(null);
await _navigationService.GoBackToRootAsync();
}
but it doesn't work. what should I do to achieve this.

Default.Color isn't working for me????

$
0
0

I have a method listed below where when I click a button connected to this method, theoretically all the buttons listed below should turn back to Color.Default. But it is not, so I'm wondering why this is not working. The code is below:

    private void Button_Clicked(object sender, EventArgs e) 
    {
        Trench.BackgroundColor = Color.Default; //DEFAULT COLOR!!!!!!
        Target.BackgroundColor = Color.Default;
        Other.BackgroundColor = Color.Default;
        currentMatch.TShootingLocation = ((Button)sender).Text;
        ((Button)sender).BackgroundColor = ButtonClickedColor;
    }

Basically, Trench, Target, and Other are all buttons defined in the XAML and it's supposed to turn all of the colors back to default and only turn the button that is clicked to a different color. The button turning to a different color but all the bttons above not turning to Color.Default is a problem. Is there anything I can do?

Content of a frame that is the View of a ViewCell appear on top of other rows in the list - iOS only


Xamarin.Forms + Skia# iOS issue

$
0
0

My Xamarin project uses Skia# and SkGlview.
Here are The Skia# nugets I use :

Everything works if I clean + rebuild all before Deploying/launching on iPhone.
But if I make a change in the code, then launch again, app can launch but a "fatal" exception is thrown as soon as any Skia code is reached.

So each time I make a change I have to Clean/Rebuild, which makes a change very expensive.
Do somebody else encounter this problem / is there a workaround?

Is it possible to integrate the HERE Maps Android/iOS SDKs into a xam.forms project?

$
0
0

Hi =)

So I believe there are two previous discussions on this:

https://forums.xamarin.com/discussion/43630/xamarin-binding-for-here-maps-problem
https://forums.xamarin.com/discussion/102803/binding-libary-incompatibility-here-maps-sdk

Currently I'm using: SDK Version: 3.11.2.82 (Premium)

The Android SDK comes as an .AAR, after extracting the .JAR, creating a Android binding library, and removing classes throwing errors:

<metadata>
  <remove-node path="/api/package[@name='com.here.android.mpa.pde']/class[@name='PlatformDataItem']" />
  <remove-node path="/api/package[@name='com.here.android.mpa.pde']/class[@name='PlatformDataItemCollection']" />
  <remove-node path="/api/package[@name='com.here.android.mpa.pde']/class[@name='PlatformDataResult']" />
  <remove-node path="/api/package[@name='com.here.android.mpa.search']/class[@name='DiscoveryRequest']" />
  <remove-node path="/api/package[@name='com.here.android.mpa.search']/class[@name='TextSuggestionRequest']" />
  <remove-node path="/api/package[@name='com.here.android.mpa.search']/class[@name='TextAutoSuggestionRequest']" />
  <remove-node path="/api/package[@name='com.here.android.mpa.search']/class[@name='GeocodeRequest']" />
  <remove-node path="/api/package[@name='com.here.android.mpa.search']/class[@name='GeocodeRequest2']" />
  <remove-node path="/api/package[@name='com.here.android.mpa.search']/class[@name='ImageMedia']" />
  <remove-node path="/api/package[@name='com.here.android.mpa.search']/class[@name='PlaceRequest']" />
  <remove-node path="/api/package[@name='com.here.android.mpa.mapping']/class[@name='MapOffScreenRenderer']" />
  <remove-node path="/api/package[@name='com.here.android.mpa.streetlevel']/class[@name='StreetLevelModel']" />
  <remove-node path="/api/package[@name='com.here.android.mpa.streetlevel']/class[@name='StreetLevelOffScreenCapture']" />
  <remove-node path="/api/package[@name='com.here.odnp.util']/class[@name='OdnpIOUtils']" />
  <remove-node path="/api/package[@name='com.here.odnp.util']/class[@name='AlarmTimer']" />
  <remove-node path="/api/package[@name='com.here.odnp.util']/class[@name='AssetCopyTask']" />
  <remove-node path="/api/package[@name='com.here.odnp.wifi']/class[@name='WifiFilterRx']" />
  <remove-node path="/api/package[@name='com.here.odnp.wifi']/class[@name='WifiFilterTimestamp']" />
  <remove-node path="/api/package[@name='com.here.odnp.posclient.pos']/class[@name='PositioningSession']" />
  <remove-node path="/api/package[@name='com.here.services.playback.internal.util']/class[@name='PlaybackReader']" />
  <remove-node path="/api/package[@name='com.here.services.radiomap.internal.util']/class[@name='IRadioMapManager']" />
  <remove-node path="/api/package[@name='com.here.services.radiomap.internal.util']/class[@name='RadioMapManager']" />
  <remove-node path="/api/package[@name='com.here.services.radiomap.internal']/class[@name='IRadioMapManager']" />
  <remove-node path="/api/package[@name='com.here.services.radiomap.internal']/class[@name='RadioMapManager']" />
  <remove-node path="/api/package[@name='com.nokia.maps']/class[@name='StringNativeMap']" />
  <remove-node path="/api/package[@name='com.nokia.maps']/class[@name='StringNativeVector']" />
  <remove-node path="/api/package[@name='com.nokia.maps']/class[@name='NavigationManagerImpl']" />
  <remove-node path="/api/package[@name='com.nokia.maps']/class[@name='StringNativeVector']" />
  <remove-node path="/api/package[@name='com.nokia.maps']/class[@name='MapImpl']" />
  <remove-node path="/api/package[@name='com.here.sdk.analytics']/class[@name='HEREAnalytics']" />
</metadata>

I got my dll, but have a very good feeling it won't work =)

The iOS SDK comes as a NMAKit.framework, is there even a remote chance of finding a way to reference this in Xamarin?

Has anyone had any recent success with implementing HERE Maps in Xamarin?

How do I solve event Binding for a Custom Control in XAML

$
0
0

I've got a custom control called MovingFrame. It's a drag-n-drop control. When dropping a dragged item onto another item a DropReceived event is fired. I've got it working with code in code behind but I would like to be able just to bind in XAML. For some reason I always get the following error message:

XFC0009 No property, BindableProperty, or event found for "DropReceived", or mismatching type between value and property.

The solution below works fine but I need code behind code to solve it. I didn't find a solution that solely depends on XAML.

The (partial) code of the custom control looks like this.

    public class MovingFrame : Frame, IDragAndDropMovingView, IDragAndDropHoverableView, IDragAndDropReceivingView
    {
        public delegate void DropReceivedEventHandler(object sender, DropReceivedEventArgs e);

        public event DropReceivedEventHandler DropReceived;

        public void OnDropReceived(IDragAndDropMovingView view)
        {
            DropReceived?.Invoke(this, new DropReceivedEventArgs(view));
        }

        protected override void OnParentSet()
        {
            base.OnParentSet();
            this.InitializeDragAndDrop();
        }
    }

Here's the implementation in XAML:

    <?xml version="1.0" encoding="utf-8" ?>
    <forms:MvxContentPage 
        xmlns="http://xamarin.com/schemas/2014/forms"
        xmlns:forms="clr-namespace:MvvmCross.Forms.Views;assembly=MvvmCross.Forms"
        xmlns:views="clr-namespace:eTabber.Views"
        xmlns:viewmodels="clr-namespace:eTabber.Core.ViewModels;assembly=eTabber.Core"
        xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
        xmlns:d="http://xamarin.com/schemas/2014/forms/design"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:tgb="clr-namespace:TGB.Xamarin.Forms.DragAndDrop;assembly=TGB.Xamarin.Forms"
        mc:Ignorable="d"
        Padding="0"
        x:Class="eTabber.Views.SetView" x:TypeArguments="viewmodels:SetlistViewModel"
        Title="{Binding PageTitle}" >

        <StackLayout
            StyleClass="MainContainer"
            Spacing="0"
            Margin="0"
            Padding="0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <Label Text="{Binding SetList.Name, Mode=OneWay}" StyleClass="Title" Grid.Row="0"></Label>
                <StackLayout Orientation="Horizontal" Grid.Row="1">
                    <Button Text="Add" Command="{Binding AddCommand}" />
                </StackLayout>
                <!--<ScrollView Margin="0" Padding="0" Orientation="Vertical" Grid.Row="2">-->
                <StackLayout BindableLayout.ItemsSource="{Binding SetItems}" x:Name="SetlistsListView" Grid.Row="2">
                    <BindableLayout.ItemTemplate>
                        <DataTemplate x:Name="RowTemplate">
                            <tgb:MovingFrame x:Name="MovingFrame" 
                                             Padding="0"
                                             Margin="0" 
                                             DropReceived="{Binding DropReceivedHandler}">
                                <StackLayout Orientation="Vertical">
                                    <Label Text="{Binding Set.SetName, Mode=OneWay}"
                                           IsVisible="{Binding TitleVisible, Mode=OneWay}"
                                           StyleClass="Title"
                                           Grid.Row="0">
                                    </Label>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="2*"/>
                                        </Grid.ColumnDefinitions>

                                        <Label Text="{Binding Path=Song.Artist.Name, Mode=OneWay}" Grid.Column="0" Grid.Row="0" StyleClass="Label"/>
                                        <Label Text="{Binding Path=Song.Title, Mode=OneWay}" Grid.Column="1" Grid.Row="0" StyleClass="Label"/>
                                    </Grid>
                                </StackLayout>
                            </tgb:MovingFrame>
                        </DataTemplate>
                    </BindableLayout.ItemTemplate>
                </StackLayout>
                <!--</ScrollView>-->
            </Grid>
        </StackLayout>
    </forms:MvxContentPage>

Code behind with the current solution:

using eTabber.Core.ViewModels;
using MvvmCross.Forms.Views;
using System.ComponentModel;
using TGB.Xamarin.Forms.DragAndDrop;
using TGB.Xamarin.Forms.DragAndDrop.DragAndDropEventArgs;
using Xamarin.Forms;

namespace eTabber.Views
{
    [DesignTimeVisible(false)]
    public partial class SetView : MvxContentPage<SetlistViewModel>
    {
        public SetView()
        {
            InitializeComponent();

            SetlistsListView.ChildAdded += SetlistsListView_ChildAdded;
        }

        private void SetlistsListView_ChildAdded(object sender, ElementEventArgs e)
        {
            var movingFrame = e.Element as MovingFrame;

            if (movingFrame != null)
            {
                var viewModel = ViewModel as SetlistViewModel;

                if (viewModel != null)
                {
                    movingFrame.DropReceived -= MovingFrame_DropReceived;
                    movingFrame.DropReceived += MovingFrame_DropReceived;
                }

            }
        }

        private void MovingFrame_DropReceived(object sender, DropReceivedEventArgs e)
        {
            var viewModel = ViewModel as SetlistViewModel;

            if(viewModel != null)
            {
                viewModel.DropReceivedHandler(sender, e);
            }
        }
    }
}

And partial viewmodel class (BaseViewModel is based on MvxViewModel):

using eTabber.Data.Model;
using TGB.Xamarin.Forms.DragAndDrop.DragAndDropEventArgs;
using Xamarin.Forms;

namespace eTabber.Core.ViewModels
{
    public class SetlistViewModel : BaseViewModel<SetList>
    {
        public SetlistViewModel(IMvxNavigationService navigationService) : base(navigationService)
        {
        }

        public void DropReceivedHandler(object sender, DropReceivedEventArgs e)
        {

        }
    }
}

Google AdMob integration issues

$
0
0

I was following Jame's tutorial on YouTube here, when I build my app the Splashscreen is go on but than the app is crashing with this error message:

Java.Lang.RuntimeException: 'Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.MobileAdsInitProvider" on path: DexPathList[[zip file "/data/app/com.companyname.theone.core-K_yTq6gblFt2NGGn-iZmeg==/base.apk"],nativeLibraryDirectories=[/data/app/com.companyname.theone.core-K_yTq6gblFt2NGGn-iZmeg==/lib/arm64, /data/app/com.companyname.theone.core-K_yTq6gblFt2NGGn-iZmeg==/base.apk!/lib/arm64-v8a, /system/lib64, /product/lib64]]'

On google/stackoverflow keep saying to use the right app id which I did.

Also, I tried to switch between the NuGet packages - the regular and the light version.
Thank you!

CollectionView child added event not firing

$
0
0

I am using Xamarin Forms and CollectionsView.I am adding Frame child rows using SignalR. Child added event is not firing after few child is added.Is it a bug or am i doing something wrong?? I tried with CollectionView_ChildAdded event also.That one also gives this unexpected behavior.I am adding item to itemsource collection using SignalR

<CollectionView x:Name="ItemsListView"               
            ItemsSource="{Binding Items}" 
            VerticalOptions="FillAndExpand"
            SelectionMode="None"
            ItemsUpdatingScrollMode="KeepScrollOffset"  
            >
                <CollectionView.ItemTemplate>
                    <DataTemplate>
                        <Frame  x:Name="frame1" BackgroundColor="White" BorderColor="#F0F0F0" Padding="3" Margin="0,0,0,5" HasShadow="False"  CornerRadius="10" ChildAdded="frame1_ChildAdded">
                            <Grid HeightRequest="40" HorizontalOptions="FillAndExpand" VerticalOptions="Start">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="2*"/>
                                    <ColumnDefinition Width="2*" />
                                    <ColumnDefinition Width="6*" />
                                </Grid.ColumnDefinitions>
                                <Label Grid.Column="0" x:Name="lb_TicketNumber" Text="{Binding TicketNumber}" TextColor="Black" FontSize="Large" FontAttributes="Bold" VerticalOptions="Center" Margin="20,0" HorizontalTextAlignment="Center"  />
                                <Label Grid.Column="1" Text="{Binding DeskName}" TextColor="Black" FontSize="Large" FontAttributes="Bold" VerticalOptions="Center" HorizontalTextAlignment="Center"/>
                                <Label Grid.Column="2" Text="{Binding ServiceNameEng}" TextColor="Black" FontSize="Large" FontAttributes="Bold" VerticalOptions="Center" HorizontalTextAlignment="Center" />
                            </Grid>
                        </Frame>

                    </DataTemplate>

                </CollectionView.ItemTemplate>

            </CollectionView>

below event stops firing after few times.

private void frame1_ChildAdded(object sender, ElementEventArgs e)
    {
        DisplayAlert("Child added", "OK", "OK");
    }
Viewing all 79144 articles
Browse latest View live