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

What is the efficient way between Carousel and Tab when we have more than 5 number of Tabs?

$
0
0

Hi, I want to create a TabbedPage and I have more than 5 tab children. All the tab children are creating dynamically. I know in tabbed page when we increase the number of tab children the performance will degrade. And Instead of tabs we can use carousel as well. In performance wise what is the more efficient way?


ContentPage.ToolbarItems disappear after change page by slash

$
0
0

ContentPage.ToolbarItems disappear after change page by slash

Hi
This is MainPage with ToolBar:

<ContentPage.ToolbarItems>


</ContentPage.ToolbarItems>

MainViewModel:
Logout = new BitDelegateCommand(async () =>
{
await securityService.Logout();
await navigationService.NavigateAsync("/Login");
});

LoginViewModel:
await securityService.LoginWithCredentials(UserName, Password, "Owner", "secret");
await navigationService.NavigateAsync("/Main");

When I click LogOut and Login again ToolbarItems disappear in MainPage.
When I remove / (slash) before "/Login" or "/Main" , problem resolves.
But I don't want user can back to before page after login or after logout.
What should I do?

Access the masterdetailpage after login

$
0
0

Hi Forum How come my app crashes after tapping the Log in

Here is my code for log in

`public partial class LoginPage : ContentPage
{
public LoginPage ()
{
InitializeComponent ();
BackgroundColor = Color.FromRgb(51,10,120);
NavigationPage.SetHasNavigationBar(this, false);
}

    async void OnLoginButtonClicked(object sender, EventArgs e)
    {
        var user = new User
        {
            Username = usernameEntry.Text,
            Password = passwordEntry.Text
        };

        var isValid = AreCredentialsCorrect(user);
        if (isValid)
        {
            App.IsUserLoggedIn = true;
            App.Current.MainPage = new MainPage();
            //Navigation.InsertPageBefore(new MainPage(), this);
            //await Navigation.PopAsync();
        }
        else
        {
            messageLabel.Text = "Login failed";
            passwordEntry.Text = string.Empty;
        }
    }

    bool AreCredentialsCorrect(User user)
    {
        return user.Username == Constants.Username && user.Password == Constants.Password;
    }
}`

How to Update label text from another class?

$
0
0

I know its a silly question but I am new in Xamarin.forms
I want to Update label text from another class in xamarin.forms. please guide me with a example. Thanks

Add a data into the Listview

$
0
0

Hi,

I use navigation page to navigate from page A to page B.
Page B only contains a Entry When a users Enter a data in the Entry. The page is poped.
Now when popping page B, I would like for page A to receive the value selected in Page B and i want to show the data into the listview
how can i do that. Please let me know if anyone have this solution for this problem

In short:
1) NavigationPage
2) Navigate from page A to page B
3) Get the Value from user
4) return selected value from page B to page A
5)Value Display into listview

Thanks in advance!

Multiple PDF file is not opening in IPhone, how can i do this..

$
0
0

How can i open the multiple pdf or folder of these files..

Does Android support SharePoint.Client/SharePoint.Client.Runtime?

$
0
0

Hello - I'm building a Xamarin Forms application that pulls information from an on prem SharePoint site. The iOS version works as intended, however the Android version crashes immediately after launching. The cause of the crash appears to be Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll (both presumably calling System.Web.dll) which returns the following, despite being referenced directly:

05-31 23:03:42.275 D/Mono ( 1586): Assembly Loader probing location: 'System.Web'.
05-31 23:03:42.275 F/monodroid-assembly( 1586): Could not load assembly 'System.Web' during startup registration.

I have tried different versions of each reference, as well as different versions of Mono Android assuming it was a compatibility issue. I've tried the common suggestions to disable shared runtime and fast deployment, and I've tested on both emulators and real devices - nothing has resulted in the Android version of my application launching.

Any help would be much appreciated, thank you in advance.

Xamarin.Forms.Build.Tasks.XamlCTask task has been marked with the attribute LoadInSeparateAppDomain

$
0
0

ALL other solution packages are up-to-date, I am using the latest stable release of Xamarin Studio for Mac (7.1 (build 1297)) running Mac OS X 10.12.6. Further below please find some ADDITIONAL STEPS TAKEN and some ADDITIONAL INFORMATION.

Just upgraded my solution from sr2 to the latest Xamarin Forms package sr5. Now getting the following build errors while building PCL library:

/Src/MYFOLDER/packages/Xamarin.Forms.2.3.4.267/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.targets(3,3): Error MSB4077: The "Xamarin.Forms.Build.Tasks.XamlCTask" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. (MSB4077) (Utilities.Api)

/Src/MYFOLDER/packages/Xamarin.Forms.2.3.4.267/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.targets(3,3): Error MSB4060: The "XamlCTask" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. (MSB4060) (Utilities.Api)

ADDITIONAL STEPS TAKEN
Cleaned entire solution

ADDITIONAAL INFORMATION:
=== Visual Studio Enterprise 2017 for Mac ===

Version 7.1 (build 1297)
Installation UUID: 034ea3f9-f985-4e7e-89e7-b970f1896033
Runtime:
Mono 5.2.0.215 (d15-3/da80840) (64-bit)
GTK+ 2.24.23 (Raleigh theme)

Package version: 502000215

=== NuGet ===

Version: 4.3.0.2418

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
1.1.1
1.0.4
SDK: /usr/local/share/dotnet/sdk/1.0.3/Sdks
SDK Version: 1.0.3
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 8.3.3 (12175.1)
Build 8E3004b

=== Xamarin.iOS ===

Version: 10.12.0.18 (Visual Studio Enterprise)
Hash: 4a279c9a
Branch: d15-3
Build date: 2017-08-02 12:38:11-0400

=== Xamarin.Mac ===

Version: 3.6.0.17 (Visual Studio Enterprise)

=== Xamarin.Android ===

Version: 7.4.0.19 (Visual Studio Enterprise)
Android SDK: /Users/kenwenyon/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
4.4.87 (API level 20)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.4
SDK Build Tools Version: 26.0.0

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Build Information ===

Release ID: 701001297
Git revision: 9c5299666538b2f8baf501418a5c064d784d64da
Build date: 2017-08-07 11:29:35-04
Xamarin addins: 3bb0c32a14f1b7e368bf5ac53a84c3581c019391
Build lane: monodevelop-lion-d15-3

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
Thu Jun 15 17:36:27 PDT 2017
root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64


Getting error: actool exited with code 255

$
0
0

I am getting the following exception when trying to build my Xamarin.Forms iOS project...
Target _CoreCompileImageAssets: Tool /Applications/Xcode.app/Contents/Developer/usr/bin/actool execution started with arguments: --errors --warnings --notices --output-format xml1 --output-partial-info-plist "/Volumes/MacBook Pro Backup/Xamarin/NSE/iOS/obj/iPhoneSimulator/Debug/device-builds/iphone7.1-11.3/actool/partial-info.plist" --app-icon AppIcons --launch-image LaunchImage --compress-pngs --filter-for-device-model iPhone7,1 --target-device iphone --minimum-deployment-target 7.1 --platform iphonesimulator --compile "/Volumes/MacBook Pro Backup/Xamarin/NSE/iOS/obj/iPhoneSimulator/Debug/device-builds/iphone7.1-11.3/actool/bundle" "/Volumes/MacBook Pro Backup/Xamarin/NSE/iOS/obj/iPhoneSimulator/Debug/device-builds/iphone7.1-11.3/actool/cloned-assets/Resources/Images.xcassets" /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error : actool exited with code 255 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: The "ACTool" task failed unexpectedly. /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: System.ArgumentException: Failed to parse PList data type: ---> System.ArgumentException: Must specify valid information for parsing in the string. /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at System.Enum+EnumResult.SetFailure (System.Enum+ParseFailureKind failure, System.String failureMessageID, System.Object failureMessageFormatArgument) [0x00024] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/enum.cs:318 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at System.Enum.TryParseEnum (System.Type enumType, System.String value, System.Boolean ignoreCase, System.Enum+EnumResult& parseResult) [0x00077] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/enum.cs:396 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at System.Enum.Parse (System.Type enumType, System.String value, System.Boolean ignoreCase) [0x00010] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/enum.cs:370 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at System.Enum.Parse (System.Type enumType, System.String value) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/enum.cs:362 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at Xamarin.MacDev.PropertyListFormat+XmlFormat+Context.ReadObjectHead () [0x00018] in <35965be2bb8347aa861de1a3bb9a5f2b>:0 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: --- End of inner exception stack trace --- /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at Xamarin.MacDev.PropertyListFormat+XmlFormat+Context.ReadObjectHead () [0x00048] in <35965be2bb8347aa861de1a3bb9a5f2b>:0 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at Xamarin.MacDev.PropertyListFormat+XmlFormat+Context..ctor (System.Xml.XmlReader reader) [0x0000f] in <35965be2bb8347aa861de1a3bb9a5f2b>:0 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at Xamarin.MacDev.PropertyListFormat+XmlFormat.StartReading (System.IO.Stream input) [0x0008a] in <35965be2bb8347aa861de1a3bb9a5f2b>:0 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at Xamarin.MacDev.PropertyListFormat.CreateReadContext (System.IO.Stream input) [0x00010] in <35965be2bb8347aa861de1a3bb9a5f2b>:0 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at Xamarin.MacDev.PObject.FromFile (System.String fileName, System.Boolean& isBinary) [0x00024] in <35965be2bb8347aa861de1a3bb9a5f2b>:0 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at Xamarin.MacDev.PDictionary.FromFile (System.String fileName, System.Boolean& isBinary) [0x00001] in <35965be2bb8347aa861de1a3bb9a5f2b>:0 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at Xamarin.MacDev.PDictionary.FromFile (System.String fileName) [0x00001] in <35965be2bb8347aa861de1a3bb9a5f2b>:0 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at Xamarin.MacDev.Tasks.XcodeCompilerToolTask.Compile (Microsoft.Build.Framework.ITaskItem[] items, System.String output, Microsoft.Build.Framework.ITaskItem manifest) [0x002d0] in <35965be2bb8347aa861de1a3bb9a5f2b>:0 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at Xamarin.MacDev.Tasks.ACToolTaskBase.Execute () [0x009ba] in <35965be2bb8347aa861de1a3bb9a5f2b>:0 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/msbuild-15/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:631 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1211,3): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x00212] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/msbuild-15/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787 Done building target "_CoreCompileImageAssets" in project "NSE.iOS.csproj" -- FAILED.

Implementing Push notifications in Xamarin Forms

$
0
0

Hello, I am working in xamarin forms for developing app from past few months, I need to implement push notifications in my app where user will be notified as any changes occurs in server database, but I am not getting proper reference anywhere for setting push notifications from web services to mobile in cross platform manner. Can anyone help me with reference links or any samples for implementing push notifications in xamarin.forms app?

Google sign in not working in Android

$
0
0

I have implemented native Google sign-in into one of my Xamarin Forms project using page renderer for Android. Till now its working fine but now it isn't. I used GoogleSignInOptions class.

In Activity Result

GoogleSignInResult result = Auth.GoogleSignInApi.GetSignInResultFromIntent(e.Data);

result.IsSuccess always false. Prior it working fine. I have checked with my Google developer console and everything is just fine nothing changed there.

Please help.

Css stylesheet issue with xamarin live player

$
0
0

When i am viewing xamarin form application in samsung tab with xamarin live player style sheet is not loading or working.

some times it gives the error like "Type StyleSheet not found in xmlns in xamarin" when I am running it in the android emulator then it is working properly

<ContentPage.Resources>

</ContentPage.Resources>
and I have created a file called home.cs inside the content folder and made build action "Embedded resource"

Can anyone tell what is issue??

Cannot access a disposed object.Object name: 'Xamarin.Forms.Platform.Android.Platform+DefaultRender

$
0
0

Hi Everyone,

I have created a Xamarin.Forms application. In my application when I click on any button my app is crashing with exception Cannot access a disposed object.Object name: 'Xamarin.Forms.Platform.Android.Platform+DefaultRenderer'. Here is the crash log

            `  Message: Cannot access a disposed object.Object name: 'Xamarin.Forms.Platform.Android.Platform+DefaultRenderer'. StackTrace:   at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <3cb12bce834a498199b2be6cd3e00922>:0   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualInt32Method (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <3cb12bce834a498199b2be6cd3e00922>:0   at Android.Views.View.get_Visibility () [0x0000a] in <ff199c98c3f84852925dd37a0ef6113a>:0   at Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateIsVisible () [0x0001d] in <fb1b373bb41f422cab210b1850374a59>:0   at Xamarin.Forms.Platform.Android.VisualElementTracker.HandlePropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x002dc] in <fb1b373bb41f422cab210b1850374a59>:0   at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00012] in <42fe931976e64c199eddde45068a6c09>:0   at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in <42fe931976e64c199eddde45068a6c09>:0   at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.BindableObject+SetValueFlags attributes, System.Boolean silent) [0x000fb] in <42fe931976e64c199eddde45068a6c09>:0   at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.BindableObject+SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0014b] in <42fe931976e64c199eddde45068a6c09>:0   at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x001f9] in <42fe931976e64c199eddde45068a6c09>:0   at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in <42fe931976e64c199eddde45068a6c09>:0   at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__47_0 () [0x00000] in <42fe931976e64c199eddde45068a6c09>:0   at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <ff199c98c3f84852925dd37a0ef6113a>:0   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <ff199c98c3f84852925dd37a0ef6113a>:0   at (wrapper dynamic-method) System.Object.ddb67896-6c72-437b-b11e-096da6069f88(intptr,intptr) Method: ; AssertSelf`

I am unable to figure out the exact reason. Is there any solution to fix it.

Cannot access a disposed object.Object name: 'Xamarin.Forms.Platform.Android.ImageRenderer'

$
0
0

Hi Everyone,

I have created a Xamarin.Forms application. In my application when I click on any button my app is crashing with exception Cannot access a disposed object.Object name: 'Xamarin.Forms.Platform.Android.ImageRenderer'. Here is the crash log

Message: Cannot access a disposed object.Object name: 'Xamarin.Forms.Platform.Android.ImageRenderer'.StackTrace: at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <2adcca1486484b3b977b571b94c7903a>:0 at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualInt32Method (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <2adcca1486484b3b977b571b94c7903a>:0 at Android.Views.View.get_Visibility () [0x0000a] in <c38061fd62ab40a98586383f36964d81>:0 at Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateIsVisible () [0x00035] in <fb1b373bb41f422cab210b1850374a59>:0 at Xamarin.Forms.Platform.Android.VisualElementTracker.HandlePropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x002dc] in <fb1b373bb41f422cab210b1850374a59>:0 at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs) at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00012] in <42fe931976e64c199eddde45068a6c09>:0 at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in <42fe931976e64c199eddde45068a6c09>:0 at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.BindableObject+SetValueFlags attributes, System.Boolean silent) [0x000fb] in <42fe931976e64c199eddde45068a6c09>:0 at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.BindableObject+SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0014b] in <42fe931976e64c199eddde45068a6c09>:0 at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x001f9] in <42fe931976e64c199eddde45068a6c09>:0 at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in <42fe931976e64c199eddde45068a6c09>:0 at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__47_0 () [0x00000] in <42fe931976e64c199eddde45068a6c09>:0 at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <c38061fd62ab40a98586383f36964d81>:0 at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <c38061fd62ab40a98586383f36964d81>:0 at (wrapper dynamic-method) System.Object.835897aa-40b8-46da-a402-79a92ebbf907(intptr,intptr)Method: ; AssertSelf

I am unable to figure out the exact reason. Is there any solution to fix it.

ListView with MVVM - TapGestureRecognizer command is not working

$
0
0

I'm using MVVM, I'm finding that trying to detect a row being clicked to invoke a command painful to implement. It would seem that there's no ItemSelected that takes a Command, so I've tried to use the TapGestureRecognizer with no success..
my viewcell is in c# as its bit complex to convert into xaml.

InSide ViewCell---

TapGestureRecognizer taponimgcheckuncheck = new TapGestureRecognizer();
taponimgcheckuncheck.SetBinding(TapGestureRecognizer.CommandProperty,"TapOnLogo");
imgcheckuncheck.GestureRecognizers.Add(taponimgcheckuncheck);

And my viewmodel is like---
public ICommand TapOnLogo{

        get{
            return new Command(() =>
            {
                Application.Current.MainPage.DisplayAlert("TapOnLogo","TapOnLogo","ok");
            });
        }
    }

Visual Studio 2015 Xamarin Forms Tools->Android-> all grayed

$
0
0

I am trying to get Visual Studio 2015 set up to do Xamarin Forms.
I have two issues (that I know of)

1) When in VS I navigate to: Tools->Android-> all the options are grayed

2) When I do an Install or Repair I get messages indicating that it had problems downloading Android SDK Setup (API Level 19 and 21). Same thing for 22 and 23.
I have what looks like an Android SDK at :
C:\Program Files (x86)\Android\android-sdk
And there is a link to it in Tools->Options->Xamarin->Android Settings.

Any insight is appreciated.

ScrollView ScrollToAsync behaviour

$
0
0

Hi,

I have been having issues with using the ScrollToAsync function of a ScrollView when running on Android, not tested on iOS yet.
I'm using Xamarin.Forms version 2.5.1.444934 using .Net Standard
Testing on the Android Emulator (8.0, API26) and a Google Pixel (8.1 API27), both have the same issue.

I use NavigationPage and Navigation.PushAsync to move between pages (therefore have navigation bars on every page).

I want to create an auto populate field control, the user types in the first few letters and I look up the results in a database / static list of string and display the results below for the user to click/tap.
I have this working using a composite control (the contents of the frame marked interesting below).
The problem I have is scrolling the view to show the results.

My page has this layout hierarchy:-

ContentPage
    StackLayout
        ScrollView
            StackLayout
                Frame (some label and entry fields inside a stack layout)
                Frame (some label and entry fields inside a stack layout)
                Frame (some label and entry fields inside a stack layout)
                Frame (the interesting one that deals with scrolling)
                    StackLayout
                        Heading Label
                        StackLayout
                            Label x:Name="ScrollToLabel"
                            Entry x:Name="ScrollToEntry"
                            Grid x:Name="ScrollToGrid"
                            Entry x:Name="Hidden" Text="I should stay visible as you type"
                        /StackLayout
                    /StackLayout
                /Frame
                Frame (some label and entry fields inside a stack layout)
                Frame (some label and entry fields inside a stack layout)
            /StackLayout
        /ScrollView
        StackLayout
            Button Text = Done
        /StackLayout
    /StackLayout
/ContentPage

When the user clicks/taps in to ScrollToEntry, the keyboard opens and pans the control to above the keyboard (ok so far).
When the user starts typing in ScrollToEntry, the code populates ScrollToGrid with up to 5 results.
At this point I want to make sure that the grid results are visible for the user to tap on.
I have tried 2 different options, ScrollToAsync(ScrollToLabel, Start) and ScrollToAsync(Hidden, MakeVisible).

Neither work as I would like 100% of the time.

ScrollToAsync(ScrollToLabel, Start)

If the ScrollToEntry is at the bottom of the screen, the navigation bar is hidden and the view pans up too far.
The ScrollToLabel is now off the top of the screen.
When the second letter is clicked/tapped, the Navigation bar is restored and the scroll scrolls correctly, ScrollToLabel at the top of the screen.
If the ScrollToEntry is near the top of the screen, the navigation bar is not hidden and it scrolls correctly.

ScrollToAsync(Hidden, MakeVisible)
This is my preferred option because it would only scroll as far as needed to display all the results (not all the way to the top).
This works even worse than the first one.
In most cases, it does not scroll at all, I assume it thinks it already visible but is actually behind the keyboard?
If it does scroll, the label Hidden is still not displayed (I tested with both a HeightRequest="0" version and a visible version, both the same result).

I tried using the below code to change the adjust to resize.
Application.Current.On<Xamarin.Forms.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);

2 issues,
1. Because it resizes, the Done button now is above the keyboard, taking up space.
2. When clicking the hardware back button (not the done or navigation back button) the previous view now has a white space where the keyboard was.
If using the done or navigation back, the screen initially appears with the white space but then refreshes to full screen.

I have created a sample app that highlights the issues (by default using pan, not resize) attached.
Its the most simple version of the layout I'm using.

Am I doing something wrong or is this just how it works?
If its how it works, this must be a bug?
If I'm doing it wrong, can someone tell me what or suggest a different way of doing it?

Thanks

Xamarin forms Listview selected item text color change

$
0
0

I am working with list view using tamarin forms.
I need to change the background color and text color of the selected item in list view. I have achieved the background color change using custom renderer.
But i am not able to change the text color of selected item.
Can you please help me out. I have given the code snippet here. This is for IOS platform.

public class CustomTextCellRenderer: ViewCellRenderer
{
private UIView bgView;

    public override UITableViewCell GetCell (Cell item, UITableViewCell reusableCell, UITableView tv)
    {
        var cell = base.GetCell (item, reusableCell, tv);
        if (bgView == null)
        {
            bgView = new UIView {
                BackgroundColor = UIColor.FromRGB(6,51,110),
            };
        }

        cell.SelectedBackgroundView = bgView;
        cell.TextLabel.HighlightedTextColor = UIColor.Red;
        return cell;
    }

}

ListView Alternating row background colors

$
0
0

Is there a way to indicate to the ListView that every other row is a different color?

        var list = new ListView()
        {
            ItemTemplate = new DataTemplate(typeof(FinancialCell)),
             .....?
        }

I haven't seen an API for it.

In the above FinancialCell (ViewCell), perhaps do we need to do it manually?

How to display reply notification that "Success" or "failure" for just a flash after login?

$
0
0

How to display reply notification that "Success" or "failure" for just a flash after login?

Viewing all 91519 articles
Browse latest View live


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