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

Gif animation while pushing a page

$
0
0

Hello everybody.

I've asked this question 2 times and got no answer, I really need help with this so if anybody has any suggestion I will be glad to hear it.
So my problem is that I am pushing a PopUp page with this plugin https://github.com/rotorgames/Rg.Plugins.Popup with an Image which has a gif as source.
I push that popup and then I create the instance of another page and push it to navigation stack, then I remove the popup from the Popup stack.
The problem is that while it is loading the page (not the popup but the normal page) the gif stops (since PushAsync locks UI).

Any suggestion?

Thank You.
P.D.: Original post with more info: https://forums.xamarin.com/discussion/179413/load-a-popup-page-with-a-gif-while-pushing-a-page-stops-its-movement#latest


Unable to connect to Apple developer account/cant find provisioning profiles

$
0
0

I am trying to connect to my apple developer account to use my certificates/provisioning profiles for a Xamarin.Forms iOS account, but I keep getting the following error when I type my credentials and try to login in VS19 windows 16.5.1

I am connected to the mac, albeit with the version mismatch issues https://forums.xamarin.com/discussion/comment/406654 where in Xcode I can see my Distribution provisioning profiles in Xcode, but in my VS Windows it doesn't find anything

I tried Automatic Provisioning, but this takes me back to my first issue where I can't connect to the Apple account.

Help, please!

Prism Navigation after Dialog results in unexpected behavior

$
0
0

While calling Navigate right after a dialog the ViewModel of the target page is loaded but the Page remains the same. If a small Task.Delay is added in between the Page is loaded along with its ViewModel normally. For the dialogs, the Prism Plugins.Popup nugget package is used. Both ways exhibit the same behavior:

await DialogService.ShowDialogAsync(App.DIALOG_ALERT);
await NavigationService.NavigateAsync(App.PAGE_KEY_LOGIN);
DialogService.ShowDialog(App.DIALOG_ALERT,
async res => await NavigationService.NavigateAsync(App.PAGE_KEY_LOGIN));

Any help in trying to understand this behavior is greatly appreciated. I want to come a more educated solution than randomly delaying. Thank you in advance.

Open FlyLayout only using Hamburger icon and disable swipe behavior to open FlyLayout view of shell

$
0
0

Summary
In my application, I need to show FlyoutItems only when I tap HamburgerIcon but not through swiping left to right. Do you have any solution for this for Android & iOS? Can you enable this option using any bool property?

API Changes
Here, FlyoutLayout behaves differently for iPad & iPhone.
In iPhone - FlyLayout opens only on swiping from left dead of the screen but not on swiping middle or right of the screen.
In iPad - FlyLayout opens on swiping anywhere in the shell page middle, left.
I can't use FlyLayoutBehavior as Locked in my MapViewScreen.
It will be helpful if you expose 2 different properties or additional property in FlyLayout behavior to disable swipe open the FlyLayout.

or kindly provide me any code solution to achieve this requirement using the renderer of the Android & iOS platform to overcome this behavior.
It will be really helpful. Thanks in advance...

Google Map

$
0
0

Hi
What is the best tool to work with Google Maps. Which has good controls and no complexity

Cluster support

Pass binding to ConverterParameter

$
0
0

I'm currently trying to modify a list of commands being passed to my view from my view model if the item in the list contains a certain value, however the ConverterParameter doesn't seem to recognize what is being passed to it. Below is what I have inside of the ListView DataTemplate:

<MyView Items="{Binding Path=BindingContext.Commands, Source={x:Reference Name=ExamplePage}, Converter={converters:MyItemsConverter}, ConverterParameter={Binding .}}">

Is it possible to set multiple bindings for a converter or pass a binding to the ConverterParameter?

How to add Firebase in Xamarin Forms ?

$
0
0

Hello everyone , I am developing my 1st app ,and I never used FireBase before ... Can anyone tell me a great tutorial or a link , where it tells all how to connect firebase with xamarin forms

How to make Scrollable Label in Collectionview Xamarin Forms

$
0
0

Hi there!
I have a Collectionview with fixed Row Height. Inside Collectionview there is Label with large description. I am trying to make this label scrollable. Can anyone help please.


ScrollView has height limitations built-in. Trying to insert very high image, it's being limited.

$
0
0

Hello!

I'm creating several pages with very long images that basically has long "landing page"-like information about products.

Here is my layout:

  <ContentPage.Content>
    <ScrollView
      >

        <Image
          HorizontalOptions="FillAndExpand"
          VerticalOptions="FillAndExpand"
                    x:DataType="pages:ProductImagePage"
                    Source="{Binding ImageFilename, Converter={StaticResource ImageResourceConverter}}"
                />     
    </ScrollView>
  </ContentPage.Content>

One image has size: 1280 × 10620
and it fits perfectly!

Another one has size:

960 × 12234

And it's not showing properly: ScrollView somehow has height limit that I was not aware of, and this high image has paddings on the sides (which means Image encountered height limit and to maintain aspect ratio it lowered width of the image)

How to remove this ScrollView limit?

Shell Application - Top Tabbar issue with the focus of the tab on IOS

$
0
0

Hi all,
The Top Tabbar of a shell application on IOS devices has a weird behavior when you tap a tab which is out of the visible range of the screen.
Step to reproduce:

  • Just create an new Shell application and add multiple ShellContents on any Tab(for example 9 ShellContents)
  • scroll to the Tab9 and tap it

The result is that the Tab9 will be activated but the focus goes back to the start
This happens only on IOS.

Images:

Do you know why is this happening and if there is work around ?
Thanks in advance!

i wanted to move the label position

$
0
0

hi , i am really new into xamarin.forms and i have an assignment based on CV displaying application. i have made the design already with workflow now i want to create my design in xamarin.forms. i am having a trouble with moving the label. i'll show you the design and i want to move the label to left side.
SKILLS text is what i want to move. can anybody help me with changing the position of label and can you please also help me in adding a new font to xamarin.forms. Thanks

CollectionView, Long press and Tap!

Hamburger Menu

$
0
0

Can someone please tell me why when I click on the Hamburger Menu button the menu (ListView) doesnt display.
Ugh...so frustrating

Is there a way to implement Augmented Reality in "Xamarin.Forms" and not natively in Andorid and iOS

$
0
0

Hi guys,
I really want to implement AR in "Xamarin.Forms" but couldn't find any solution, there are many solutions for Native Android and iOS, but nothing for Xamarin.Forms..!

Any help will be much appreciated

How can I handle this kind of crash and it happens occasionally

$
0
0

This crash happens while switching between applications.

mono.java.lang.RunnableImplementor.run
RunnableImplementor.java, line 30
Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown


Element names in Style.xml

$
0
0

Hi,

I want to know the list of elements names that can be used for styling in style.xml in android project of Xamarin forms.
To clarify what I am looking for, following are some element names colorPrimary, drawerArrowStyle, **colorPrimaryDark **etc...

Is there any documentation online. I tried looking for same but could not get any help.

Thank you.

Regards,
Mukesh Jayaswal

Not able to install an app when other app already installed with same provider in android device.

$
0
0

ADB0010: Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_CONFLICTING_PROVIDER: Package couldn't be installed in /data/app/com.package1-FNVNvrTmReyC06nRui516g==: Can't install because provider name com.iceteck.silicompressor.provider (in package package1) is already used by package2]

I did a few things like changing Android: Authorities name but it didn't work, please help to resolve this issue

Performance Issue

$
0
0

Hey guys I am facing a problem that I don't know much what to do. I am developing a Xamarin.Forms application that whenever I am in the battery economy mode it becomes very slow when I leave the app and come in again. It works just fine when the application is open, but when I leave and wait for like 10 seconds and come back it takes around 20 seconds to show the screen for me, then it works fine again. It doesn't happen in the normal battery mode. Also I have a task running in the background with a request to one api every 15 seconds with a timeout of 1 second. This task I am using Device.BeingInvokedOnTheMainThread and a CancellationToken. I did make sure that I was not having duplicates of the thread. Any ideas?

Cases where In UWP an Entry does not display existing data until the field is tapped. Works in Droid

$
0
0

I am developing an app for Droid, iOS and UWP. Environment: Win 10 Pro 1909; VS 2019 Pro 16.4.5; Xamarin 16.4

Recently I noticed that there are cases where only in UWP an Entry does not display data from the Model. The data is there. If I click or tap on the field the data that I expect to see there appears. That is not the expected behavior.
Thankfully I have a page that had both working fields and broken ones. The following works:

    <StackLayout Orientation="Horizontal">
            <Entry x:Name="Desc" FontSize="20"   TextColor="Black" BackgroundColor="White" 
                HeightRequest="48" HorizontalOptions="FillAndExpand" 
                Text="{Binding CDM.CD.descp}"  Placeholder="Description"   VerticalOptions="Center"
                TextChanged="OnDescTextChanged" />
            </StackLayout>

However, if I replace Orientation="Horizontal" with Vertical or remove the StackLayout completely, it breaks as described.
With only adding a bit of stink to the code, I can make that display as expected.
Related to this, is using an Entry within a Grid. The following code displays a blank until I tap in the field:

                     <Entry Grid.Row="2" Grid.Column="1" BackgroundColor="White" FontSize="18" 
                                       VerticalOptions="Center"
                                       Text="Sam"/>

The Label cells display fine. The Entry cells do not (only in UWP). I suppose I could replace the Grid with a number of StackLayouts but I understand that one should not do that.
Have others come across this? any suggestions?
Thanks!

Can't successfully migrate to Xamarin Forms 4.5+ and AndroidX.

$
0
0

Hi. The following are the steps that I have taken to upgrade an app to Xamarin Forms 4.5+ and AndroidX.
It looks OK until near the end where I get errors but I do not know why. I did not get them before. Are they due to AndroidX or something else.

I have:
1) installed VS 2019 16.5.1
2) installed XF 4.5.0.495
3) in Tools->Options->Xamarin->Android Settings, I have checked Enable AndroidX Migrator (Experimental)
3) right click on the android project and select Migrate to AndroidX
That is all looking good. Now try:

4) run in debug in droid on a real phone.

get the following message:

Severity    Code    Description Project File    Line    Suppression State
Error       Could not find 3 Android X assemblies, make sure to install the following NuGet packages:
 - Xamarin.AndroidX.MediaRouter
You can also copy-and-paste the following snippet into your .csproj file:
    <PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.1.0" />         

Hmmm... my droid.csproj file does not have lines with PackageReference on them. So, I will try to install the nuget.

The nuget installed fine. When I checked the droid.csproj file, it had the following new lines:

<Reference Include="Xamarin.AndroidX.MediaRouter, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\..\packages\Xamarin.AndroidX.MediaRouter.1.0.0\lib\monoandroid90\Xamarin.AndroidX.MediaRouter.dll</HintPath>
</Reference>

So maybe those replace the PackageReference lines.
Try running again.

Now I get the message:

Severity    Code    Description Project File    Line    Suppression State
Error       Could not find 1 Android X assemblies, make sure to install the following NuGet packages:
 - Xamarin.AndroidX.AppCompat.Resources
You can also copy-and-paste the following snippet into your .csproj file:
    <PackageReference Include="Xamarin.AndroidX.AppCompat.Resources" Version="1.1.0" /> i_TraxMobile.Droid          

Ok. Try installing the nuget.
But wait! it is installed already - according to the nuget installer.

Looking in the .csproj, it is not there.
I do find
<Reference Include="Xamarin.AndroidX.AppCompat,...
and so I make a copy of the three lines and make it look like it belongs to Xamarin.AndroidX.AppCompat.Resources.

    <Reference Include="Xamarin.AndroidX.AppCompat.Resources, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
      <HintPath>..\..\packages\Xamarin.AndroidX.AppCompat.Resources.1.1.0\lib\monoandroid90\Xamarin.AndroidX.AppCompat.Resources.dll</HintPath>
    </Reference>

Close VS.
Reopen the solution in VS.
Run it.
Get a bunch of errors.

Severity    Code    Description Project File    Line    Suppression State
Error       resource style/Theme.AppCompat.Light.NoActionBar (aka com.itraxonline.itraxmobile:style/Theme.AppCompat.Light.NoActionBar) not found.   i_TraxMobile.Droid          
Error       resource style/Theme.AppCompat.Light.Dialog (aka com.itraxonline.itraxmobile:style/Theme.AppCompat.Light.Dialog) not found. i_TraxMobile.Droid          
Error       failed linking references.  i_TraxMobile.Droid          
Error       resource style/Theme.AppCompat.Light.DarkActionBar (aka com.itraxonline.itraxmobile:style/Theme.AppCompat.Light.DarkActionBar) not found.   i_TraxMobile.Droid          
Error       resource style/Theme.AppCompat.Light.NoActionBar (aka com.itraxonline.itraxmobile:style/Theme.AppCompat.Light.NoActionBar) not found.   i_TraxMobile.Droid          
Error       style attribute 'attr/windowNoTitle (aka com.itraxonline.itraxmobile:attr/windowNoTitle)' not found.    i_TraxMobile.Droid  C:\Users\Will\source\repos\main\i-TraxMobile\i_TraxMobile.Droid\Resources\values\styles.xml 2   
Error       style attribute 'attr/colorPrimaryDark (aka com.itraxonline.itraxmobile:attr/colorPrimaryDark)' not found.  i_TraxMobile.Droid  C:\Users\Will\source\repos\main\i-TraxMobile\i_TraxMobile.Droid\Resources\values\styles.xml 2   
Error       style attribute 'attr/windowActionBar (aka com.itraxonline.itraxmobile:attr/windowActionBar)' not found.    i_TraxMobile.Droid  C:\Users\Will\source\repos\main\i-TraxMobile\i_TraxMobile.Droid\Resources\values\styles.xml 2   
Error       style attribute 'attr/colorPrimary (aka com.itraxonline.itraxmobile:attr/colorPrimary)' not found.  i_TraxMobile.Droid  C:\Users\Will\source\repos\main\i-TraxMobile\i_TraxMobile.Droid\Resources\values\styles.xml 2   
Error       style attribute 'attr/colorAccent (aka com.itraxonline.itraxmobile:attr/colorAccent)' not found.    i_TraxMobile.Droid  C:\Users\Will\source\repos\main\i-TraxMobile\i_TraxMobile.Droid\Resources\values\styles.xml 3   
Error       style attribute 'attr/colorAccent (aka com.itraxonline.itraxmobile:attr/colorAccent)' not found.    i_TraxMobile.Droid  C:\Users\Will\source\repos\main\i-TraxMobile\i_TraxMobile.Droid\Resources\values\styles.xml 4   
Error       style attribute 'attr/windowActionModeOverlay (aka com.itraxonline.itraxmobile:attr/windowActionModeOverlay)' not found.    i_TraxMobile.Droid  C:\Users\Will\source\repos\main\i-TraxMobile\i_TraxMobile.Droid\Resources\values\styles.xml 4   

Where did they come from? Ok - so they came from styles.xml. But why??

Here is the styles.xml file.

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
  <style name="MainTheme" parent="MainTheme.Base">
  </style>
  <!-- Base theme applied no matter what API -->
  <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
    <item name="windowNoTitle">true</item>
    <!--We will be using the toolbar so no need to show ActionBar-->
    <item name="windowActionBar">false</item>
    <!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette -->
    <!-- colorPrimary is used for the default action bar background -->
    <item name="colorPrimary">#2196F3</item>
    <!-- colorPrimaryDark is used for the status bar -->
    <item name="colorPrimaryDark">#1976D2</item>
    <!-- colorAccent is used as the default value for colorControlActivated
         which is used to tint widgets -->
    <!--<item name="colorAccent">#FF4081</item>-->
    <item name="colorAccent">#00CC00</item>
    <!-- You can also set colorControlNormal, colorControlActivated
         colorControlHighlight and colorSwitchThumbNormal. -->
    <item name="windowActionModeOverlay">true</item>
    <item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
  </style>
  <style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
    <item name="colorAccent">#FF4081</item>
  </style>
  <!-- Following added for splash screen-->
  <!--  from http://lukealderton.com/blog/posts/2016/august/xamarin-forms-splash-screen-on-android-and-ios.aspx -->
  <style name="MyTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
  </style>
  <style name="MyTheme" parent="MyTheme.Base">
  </style>
  <style name="MyTheme.Splash" parent="Theme.AppCompat.Light.NoActionBar">
    <!--<item name="android:windowBackground">@drawable/splash</item>-->
    <item name="android:windowBackground">@drawable/splash_screen</item>
    <item name="android:windowNoTitle">true</item>
  </style>
</resources>

Any insight regarding the AndroidX migration steps or how to fix these final errors are greatly appreciated.

Viewing all 91519 articles
Browse latest View live