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

ScrollTo is not working properly.

$
0
0

I have used RecyclerView for pagination in xamarin form. But when I am using ScrollTo method for automatic scrolling to desired element. But it is not scrolling to location.

Please let me know if anyone has same type of issue or have solution for this issue, please let me know..


Is it possible to switch off autocorrect on iOS custom forms elements

$
0
0

I have been asked to disable autocorrect on an iOS form view and can't work out how to do it. The XAML looks like this:

< local:ValidatedEntry x:Name="FirstName"
Header="First name"
InvalidText="The text you have entered is too long or not provided"
HeaderFont="{x:Static local:StyleConstants.FormFieldTitleFont}"
Text=""
ValidMode="MinMax" Min="1" Max="30" CapitaliseText="true" >

I tried setting the autocorrectionType property to UITextAutocorrectionType.No, but, presumably because the ValidatedEntry class inherits from ContentView, this doesn't work. I can't find much information on this on line - does anyone know how to switch off autocorrect on custom elements?

Thanks

Denise

System.Reflection.TargetInvocationException when calling a DisplayAlert

$
0
0

Yep, a new one. And this time this happens to ANY project.

Whenever a call to DisplayAlertS is made, we get this exception:

System.Reflection.TargetInvocationException

Exception has been thrown by the target of an invocation.

at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00081] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:409
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Reflection/MethodBase.cs:53
at Xamarin.Forms.MessagingCenter+Subscription.InvokeCallback (System.Object sender, System.Object args) [0x00064] in D :\a\1\s\Xamarin.Forms.Core\MessagingCenter.cs:94
at Xamarin.Forms.MessagingCenter.InnerSend (System.String message, System.Type senderType, System.Type argType, System.Object sender, System.Object args) [0x0006b] in D :\a\1\s\Xamarin.Forms.Core\MessagingCenter.cs:217
at Xamarin.Forms.MessagingCenter.Xamarin.Forms.IMessagingCenter.Send[TSender,TArgs] (TSender sender, System.String message, TArgs args) [0x00013] in D :\a\1\s\Xamarin.Forms.Core\MessagingCenter.cs:115
at Xamarin.Forms.MessagingCenter.Send[TSender,TArgs] (TSender sender, System.String message, TArgs args) [0x00000] in D :\a\1\s\Xamarin.Forms.Core\MessagingCenter.cs:108
at Xamarin.Forms.Page.DisplayAlert (System.String title, System.String message, System.String accept, System.String cancel) [0x00039] in D :\a\1\s\Xamarin.Forms.Core\Page.cs:205
at Xamarin.Forms.Page.DisplayAlert (System.String title, System.String message, System.String cancel) [0x00000] in D :\a\1\s\Xamarin.Forms.Core\Page.cs:195
at RegularesMarina.MainPage.GoFave (System.Object sender, System.EventArgs e) [0x0003e] in /Users/macbookpro/proyectos/RegularesMarina/RegularesMarina/Pages/MainPage.xaml.cs:125
at Xamarin.Forms.Button.Xamarin.Forms.Internals.IButtonElement.PropagateUpClicked () [0x00000] in D :\a\1\s\Xamarin.Forms.Core\Button.cs:185
at Xamarin.Forms.ButtonElement.ElementClicked (Xamarin.Forms.VisualElement visualElement, Xamarin.Forms.Internals.IButtonElement ButtonElementManager) [0x0001f] in D :\a\1\s\Xamarin.Forms.Core\ButtonElement.cs:61
at Xamarin.Forms.Button.SendClicked () [0x00000] in D :\a\1\s\Xamarin.Forms.Core\Button.cs:171
at Xamarin.Forms.Platform.Android.ButtonRenderer+ButtonClickListener.OnClick (Android.Views.View v) [0x0000f] in D :\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ButtonRenderer.cs:325
at Android.Views.View+IOnClickListenerInvoker.n_OnClick_Landroid_view_View
(System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_v) [0x00011] in :0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.33(intptr,intptr,intptr)

Soo, yeah. we need to fix this A.S.A.P.

Oh, and doing the

Device.BeginInvokeOnMainThread (new Action (async () =>
                {
                    await DisplayAlert ("Title", "Message", "Ok");
                }));

trick does not work.

Please and thank you.

iOS Code signing issue

$
0
0

I am getting this error when build the project. I have download Provisioning profile and certificates to the mac.
I have added these two certificates also with my certificates. Is there any missing certificates. Please help

  • Apple World Wide Developer Relations Certification Authority
  • Apple integration integration certification authority

Easy Datepicker Selection Date

$
0
0

Actually in Android the DatePicker is showed acording to phone model, Android version and others. But in the next form is very complicated, is not a comfortable for the user to do many clics to get a desired date.

For example today is 22/01/2020 but I want to change a date like a 26/10/1991. How to get a solution to change the date easily?

Triggers vs CanExecute

$
0
0

Sorry if this isn't the correct place to post this question but I've been wondering about the differences between using a trigger with a binding condition set to a behavior to do something such as making a button enabled (and thus clickable) based on an entry value vs just using the can execute functionality of a command using the view model entry text value binding.

I've seen threads where both are recommended for use and I've personally implemented them both myself to test them out. Just wanted to see if one of them is considered a best practice vs the other and why.

How to use REST API in Xamarin.Forms - Is it possible?

$
0
0

Hello, I am trying to integrate GoToMeeting app in Xamarin Forms PCL project instead of launching the app from my app. I want the users to be able to schedule meetings via GoToMeeting but it should be integrated in the app. I tried contacting GoToMeeting and they said that their API is just a REST API. I am new to Xamarin so I do not know much about how to use REST API within Xamarin framework. Is it even possible? If so, any detailed information on how to go about it would be really appreciated. Thank you!!

Also, here is the API calls I am trying to use: https://goto-developer.logmeininc.com/content/gotomeeting-api-reference

What REST client are you using?

$
0
0

Hello,

I'm currently using RESTSharp.Portable to access REST services. I'm using this as I'm familiar with RESTSharp. What are you all using?

-Mark


Hide menu icon in Action bar

$
0
0

How do I hide the ActionBar menu icon? I tried it in several ways and in one of them I used ActionBar.SetIcon (null); after LoadApplication (new App (myPage)) but without success.

No data while Reading Data from weight machine in RS-232 Serial Port Communication in xamarin.forms

$
0
0

Hi , i am trying to read data from weigh machine using RS-232 serial port communication in xamarin.forms .While reading data i am getting null data , can any one help me out of this
Here is my code,
// Getting port open here
if (srport != null)
if (srport.IsOpen)
srport.Close();
srport = new SerialPort("COM1", 9600,Parity.None,8,StopBits.One);
var str =srport.Open();
Console.WriteLine(str);
if (srport.IsOpen)
{
srport.ReadTimeout = 5000;
ReadData();
}

// Reading Data here
public string ReadData()
{
byte tmpByte;
string rxString ="";
string lineReadIn="";

            while (srport.BytesToRead > 0)
            {
                lineReadIn += srport.ReadExisting();
               Thread.Sleep(100);
            }
          return lineReadIn;
        }

Thankyou in advance

how to create horizontal and vertical listview in a content page?

$
0
0

How to create horizontal and vertical listview in a content page?

Expand and collapse option with same Image button click.

$
0
0

Hi,

I need expand and collapse option with same Image button click.

Thanks
Rk.Moorthy

Editor does not expand properly on iOS when text exceeds existing editor size

Xamarin Forms 4.0 Using TabbedPage Tab But look black screen.

$
0
0

Hi everyone !
I'm trying to use a tab. But when I click x, my pages look black.


Rg.Plugins.Popup - Move animation not working

$
0
0

Hello,

I want to create a simple popup sliding from the bottom of the screen using Rg.Plugins.Popup. Here is my code for the popup page:

<?xml version="1.0" encoding="utf-8" ?>
<rgPages:PopupPage xmlns="http://xamarin.com/schemas/2014/forms"
             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:rgPages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
             xmlns:rgAnimations="clr-namespace:Rg.Plugins.Popup.Animations;assembly=Rg.Plugins.Popup"
             mc:Ignorable="d"
             x:Class="App1.MyPopupPage">
    <rgPages:PopupPage.Animation>
        <rgAnimations:MoveAnimation PositionIn="Bottom" PositionOut="Bottom"
                                    DurationIn="2400" DurationOut="2300"
                                    />
    </rgPages:PopupPage.Animation>
    <StackLayout Margin="12"
                 Padding="24"
                 BackgroundColor="White"
                 HorizontalOptions="Center"
                 VerticalOptions="Center">
        <StackLayout>
            <Label Text="Login" />
            <Entry FontSize="30"
                   Text="username@email.com" />
        </StackLayout>
        <StackLayout>
            <Label Text="Password" />
            <Entry FontSize="30"
                   IsPassword="True"
                   Text="password123" />
        </StackLayout>
        <Button BackgroundColor="DodgerBlue"
                FontSize="30"
                Text="Login"
                TextColor="White" />
    </StackLayout>
</rgPages:PopupPage>

However, this is not working. Popup is just abruptly appearing in the center of the screen. It is not sliding from the bottom. Is it a bug in this plugin or maybe I am doing something wrong?

I am working on Android. I have uploaded the full project as an attachment.

I will be very glad for any help with this problem.


How to handle exceptions in a non-UI thread code?

$
0
0

I ran into two threading-related issues, where an exception is swallowed:
1. The page is not navigated to after the landing page, and to find out the problem I had to debug into every line of code (F11) until I reached the code that has the error (null reference) after this line, nothing happens, and the page isn't navigated to.

For the second issue: I had to run the entire page initialization in the main thread, using: Device.BeginInvokeOnMainThread when I realized that the exception is being swallowed when not running in the main thread.

to make sure of this conclusion I wrote code in the view model in a test project, that raises null reference exception, but it did raise exception! (! because "isn't view model code a non-UI related work?").
so it seems there is a random switching between a UI thread and other threads.
so how can I handle these exceptions so I don't spend hours debugging and hating on myself and my work?

Push notification feature in Xamarin forms Project

$
0
0

Hi All,

I want to implement Push notification in Xamarin forms Application.
I have no idea how push notification works. My basic requirement is App should send push notification for 30 days.
and when I click on notification it should navigate to particular screen in the App

Please help me with this.

Thanks in Advance

iOS 13.0 Broke MasterDetailPage on iPads?

$
0
0

I have noticed that after updating iOS to v13.0, the MasterDetailPage is broken on iPads but it's still working on iPhones and Androids.
By broken I mean the whole page is white, without content.


The only way to fix this is to update Xamarin.Forms to the latest v4.2+.

The problem is that some other packages are not compatible (XF broke something else after v4.0) so I cannot update XF yet.
The App Store is rejecting my app because it shows a white screen on iPads with iOS 13.0+....so I would have to stop targeting iPads!

Try for yourself, here is a basic sample repo with MasterDetail page (the default Xamarin Forms template with MasterDetailPage).
https://github.com/stesvis/MasterDetailTest2

The same happens with Prism MasterDetailsPage:
https://github.com/stesvis/MasterDetailTest

  • iPhones: works
  • iPad -> iOS 12.2: works
  • iPad -> iOS 13.0: white screen

Any solution for this HUGE headache?

Why editor text doesn't change the color

$
0
0


Hi everyone I have editor and in the xaml I write the propyte TextColor="White" but when I test the app the text is black

Is there a way to update the viewcell (height) once it is rendered?

$
0
0

i am using listview with template selector, one template is for message and one template is for writing new comment. the data template selector works fine. i am using editor for writing new comment because we want multi line comments, which works fine too its height increases if i tap enter button on keyboard.

the only issue which i am facing is the listview Item height, it is not increasing while the editor grows in height and goes outside of the view, next listview item overlaps the editor. Although listview item height refreshes and shows full editor once it goes outside the screen.

i am setting ViewCell height manually and also firing the Grid's InvalidateMeasure() for the grid layout, but nothing helping. Any Ideas?

On android it works fine only facing it on ios.

Viewing all 77050 articles
Browse latest View live


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