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

How to Decrease Height of Navigation bar in xamarin forms

$
0
0

I have used MasterDetail page as main page of my app. Here TabbedPage is my detail page which contain various ContentPage as children of TabbedPage. I have set Details as Detail = NavigationPage(tabbedpage); it work great for IOS but in android it occupie more space in NavigationBar title and Tabbed Name, I cannot omit both, my question is how can i reduce the height of title bar of navigation page. Please check attached image for reference.


UWP hide button which shows secondary ToolbarItems?

$
0
0

Hey,

I'm not using any secondary ToolbarItems in my app. Therefore, I don't need this button (not sure how to call it?):

Since I don't have any secondary ToolbarItems, the only thing clicking this button does is showing the text of the primary ToolbarItems:

Is there any way to hide this button in UWP?

How to Integrate Stripe payment gateway in xamarin forms

$
0
0

Hi every one, I am trying to integrate stripe in my xamarin forms application. I have added the component and I have done some code for integrating this payment gateway to my application. I am generating token from user given card details but How to send this token to server for payment. What I have tried is

var stripView = new StripeView();

   card = _stripView.Card;

   card.CVC = "123";
   card.Number = "4242 4242 4242 4242";
   card.ExpiryYear = 20;
   card.ExpiryMonth = 10;

var token = await StripeClient.CreateToken(card);

I am getting 'token' from this details but I don't know the root map What I have done next for continue the payment process. Please suggest any idea. Thanks in advance.

System.Data.SqlClient

$
0
0

I want to add System.Data.SqlClient in Portable (not in iOS or Android), on a cross-platform aplication, is possible?

How to create a master detail page with items and sub items ?

$
0
0

How to get a master detail page with items and sub items like this ?

Style FontSize OnPlatform in Xaml

$
0
0

Hi everybody, i'm looking for a way to change the fontsize of all my labels with a style defined in App.xaml (XF 1.3).

But i don't find any way to make it works.
Note : i want to make it with xaml in app.xaml

<Style x:Key="Titre"
       TargetType="ctrls:Label">
    <Setter Property="FontAttributes"
            Value="Bold"/>
    <Setter Property="ctrls:Label.FontSize">
        <Setter.Value>
            <OnPlatform x:TypeArguments="x:Double">
                <OnPlatform.iOS>18</OnPlatform.iOS>
                <OnPlatform.Android>18</OnPlatform.Android>
                <OnPlatform.WinPhone>26</OnPlatform.WinPhone>
            </OnPlatform>
        </Setter.Value>
    </Setter>
</Style>

The bold attribute worked but no luck with fontsize.

I've tryed different solutions :
<OnPlatform.iOS>
18</x :Double>
</OnPlatform.iOS>

Even this line doesn't work :
<Setter Property="FontSize" Value="30"/>

I can declare style for everything except fontsize. What am i doing wrong ?

(please Xamarin Team, do something for the code we paste here : there are always some text hidden, some lines missing etc. I don't know how the hell you came up with such a weird behavior but i d rather prefer simple text without formating that half the code i paste. We are not here to edit our message 10 times. I spend more time editing my code than writing the entire message. Thank you guys)

Exemple : my code OnPlatform.iOS x double 18 shows half the code in my browser. So people will think i don't care about this post because there are code missing but no. The text is just hidden for no reason.

How to press a button contained in ListView ItemTemplate without firing ListView.ItemSelected event?

$
0
0

I have a ListView whose ItemTemplate is a ViewCell, which contains a grid with some labels, a switch and a button. When I press the button, the background color of the grid is to be changed, while if I select the ListView item, the app should navigate to a page displaying details for that item. However, when I press the button, the background of the grid changes AND the app navigates to the item details page.

What my issue boils down to is this:
I want the button's command on the VM to execute WITHOUT the ListView.ItemSelected event being fired. I can toggle a switch control (within the same ItemTemplate of the same ListView) without firing the ListView.ItemSelected event. Shouldn't the same be true for a button?

Entry IsPassword TextColor

$
0
0

I set the Entry text seems to be following the textcolor but when I set IsPassword to true, only black color is shown for dots. How to change the dots to my desired color?

This is my xaml code:

        <local:TransparentEntry
                        IsEnabled = "false" Text = "899" IsPassword = "false" FontSize = "12" TextColor = "#ffffff" BackgroundColor = "Black"/>

I also tried setting textcolor to "White" Still no luck.

//EDIT

Seems like it is caused by the IsEnabled property. But I don't need the user to edit the text but i also need the IsPassword feature


Xamarin forms custom webview's navigating and navigated event doesn't raise on ios

$
0
0

I am using custom web view controller for my xamarin forms project and using this one: https://github.com/xamarin/recipes/blob/master/cross-platform/xamarin-forms/Controls/DisplayPDF/iOS/CustomWebViewRenderer.cs

but Navigating and Navigated event doesn't raise for my ios project but it is working for android.

Can anybody has faced such problem? Why those two events doesn't triggering for ios but if I directly use webview instead of custom renderer then those two events are working, why can body help me?

How to set Listview caching strategy per platform?

$
0
0

How do I set the caching strategy per platform? For example I want RecycleElement for iOS and RetainElement for Android....

I am using the following but doesnt appear to be working:

<ListView x:Name="ListViewPlaces" SeparatorVisibility="None" HasUnevenRows ="True" IsPullToRefreshEnabled="False" >

      <x:Arguments>
        <ListViewCachingStrategy>
          <OnPlatform x:TypeArguments="ListViewCachingStrategy" iOS="RetainElement" Android="RecycleElement"/>
        </ListViewCachingStrategy>
      </x:Arguments>

What could be causing my MTouch error in my Xamarin Forms iOS App?

$
0
0

I am at a bit of a loss with this issue as it started on it's own (radomly it seems) and despite following a few potential solutions I found online, nothing has resolved it. The solutions where things like:

  • Clean the entire project
  • Delete the bin/obj directories from the iOS Project
  • Ensure Xamarin is up to date on both machines
  • Clear all settings on the simulator itself
  • Ensure Xcode is up to date

I am building a cross platform phone app using Xamarin Forms in Visual Studio 2015. I run the app via the simulator on my MacBook Pro, all this was working fine until I tried to run the project today and I got the following error message and the app closed itself immediately after the launch screen with the following error message:

InspectorDebugSession(9): HandleTargetEvent: TargetExited
InspectorDebugSession(9): Disposed
Launch failed. The app 'MyApp.iOS' could not be launched on
'iPhone 7 iOS 10.3'. Error: An error occurred while executing MTouch.
Please check the logs for more details.
The app has been terminated.`

I checked the logs but I have to admit I'm having trouble locating where it's going wrong and how to potentially fix it. The log files I looked at (Help -> Xamarin -> Open Logs... ) have the following stack trace surrounding the MTouch termination.

Xamarin.Messaging.Client.MessagingClient|Error|0|An error occured on the receiver while executing a post for topic xvs/idb/4.5.0.486/launch-app and client vs18980Allan

Xamarin.Messaging.Exceptions.MessagingRemoteException: An error occured on client IDB450486 while executing a reply for topic xvs/idb/4.5.0.486/launch-app --->
Xamarin.Messaging.Exceptions.MonotouchException: An error occurred while executing MTouch
  at Xamarin.Messaging.IDB.MTouch+<RunAsync>d__8.MoveNext () [0x0023d] in <64772f494a614faaae0715fc899773b0>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
  at Xamarin.Messaging.IDB.MTouch+<RunAsync>d__7.MoveNext () [0x00080] in <64772f494a614faaae0715fc899773b0>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
  at Xamarin.Messaging.IDB.MTouch+<LaunchAsync>d__5.MoveNext () [0x000b8] in <64772f494a614faaae0715fc899773b0>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
  at Xamarin.Messaging.IDB.LaunchAppMessageHandler+<RunMTouchAsync>d__15.MoveNext () [0x0017a] in <64772f494a614faaae0715fc899773b0>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
  at Xamarin.Messaging.IDB.LaunchAppMessageHandler+<ExecuteOnSimulatorAsync>d__11.MoveNext () [0x00088] in <64772f494a614faaae0715fc899773b0>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
  at Xamarin.Messaging.IDB.LaunchAppMessageHandler+<ExecuteAsync>d__10.MoveNext () [0x00094] in <64772f494a614faaae0715fc899773b0>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357
  at Xamarin.Messaging.Client.RequestHandler`2+<HandleAsync>d__5[TMessage,TResult].MoveNext () [0x0010f] in <78aaaa6869e1440c869cc99db78028b2>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
  at Xamarin.Messaging.Client.MessageHandlerManager+<>c__DisplayClass17_1`2+<<RegisterHandlerAsync>b__1>d[TMessage,TResult].MoveNext () [0x000a9] in <78aaaa6869e1440c869cc99db78028b2>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
  at Xamarin.Messaging.Client.MessagingClient+<ReplyAsync>d__34`2[TRequest,TResponse].MoveNext () [0x000c5] in <78aaaa6869e1440c869cc99db78028b2>:0
   --- End of inner exception stack trace ---

Can anyone shed some like on what has gone wrong? I've made sure that my Xamarin installation on both machines is up to date. XCode is up to date, Xamarin Studio is up to date, Visual Studio is up to date too.

Many thanks

Browse emulator's files

$
0
0

I'm testing the use of SQLite in xamarin forms using Xamarin Studio on mac and I would like to found the files corrisponding to the app started on the emulators (android or iOS). For debug, I would like to found the emulator's app sqlite file and, using for example Firefox SQLite manager, check the data inside the db to understand if my app works correctly.

So, my question is: when the app starts into the emulator, what is the path of its files?

_navigationService.NavigateTo is not working after move from Xamarion.android to PCL projcet

$
0
0

Hi,

I am using ccavenue service to implement my payment gateway. For Android, after payment done i am using below code to back to PCL project.

    [Export("processHTML")]
            // to become consistent with Java/JS interop convention, the argument cannot be System.String.
            public void processHTML(Java.Lang.String response)
            {
                string status = null;
                if (response.IndexOf("Success") != -1)
                {
                    status = "";
                    try
                    {
                        Intent intent = new Intent(Android.App.Application.Context, typeof(MainActivity));
                        Bundle b = new Bundle();
                        b.PutString("aaaa", "aaaa");
                        intent.AddFlags(ActivityFlags.NewTask);
                        intent.SetFlags(ActivityFlags.NewTask);
                        intent.PutExtra("fileName", "SplashScreen");
                        intent.PutExtras(b);
                        Android.App.Application.Context.StartActivity(intent,b);
                        return;
                    }

PCL project, have following code:

protected override void OnCreate(Bundle bundle)
    {
        try
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource = Resource.Layout.Toolbar;
            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App());
        }
        catch (Exception ex)
        {

        }

    }

But after back from android to PCL, my code to navigation is not working. below code is doing nothing. Even it works if i closed my application and restart it.

_navigationService.NavigateTo(ViewModelLocator.questions)

Please help.

How to find controls inside list view cell

$
0
0

How to find controls inside a list view cell. I would like to change the color of label which is in list view cell

How to handle notification click on cross-platform project

$
0
0

Hi, I'm receiving notification from notification hub for both iOS and Android.
Behaviour to reach:
The app at startup after the login register to push notification, now when I receive a notification I want to open a web view passing a parameter received from the notification. For Android I'm able to do this using this code:

protected override void OnAppearing()
        {
            base.OnAppearing();

            if (!AppContext.IsLogged) {
                ShowLoginForm();
            } else if (_isFirstAppearing) {
                LoadContent();
                if(AppContext.IsNotificationOnQueue){ // here is a boolean that if true means i need to open the page after receiving a notification
                    GoToComunications (); // here i'll go to the correct page
                }
            }
            _isFirstAppearing = false;
        }

Now for iOS this does not works, if the app is running on background, after clicking the notification the app start but it does not call the method OnAppearing().... I'd like to handle this using xamarin forms, if not possible, how can I implement the behaviour that I want?


Xamarin.Forms, On Android, there is a black bar across the top of the screen

$
0
0

Hi All

I am having a strange problem on Android, when i run on Android emulator I have the below black bar running across the screen, it does the same on my physical device Samsung S8.

problem with adding a searchview in a navigationbar for a tabbed page

$
0
0

XamarinForms:
I have inserted a search view in the navigation bar following the article However If I implement it for a tabbed page , and whenever i switch the tab the search view disappears as if the navigation bar resets somehow . has anyone an idea about what is going on ?

Trouble in display image from url...

$
0
0

Dear Sir,
I am new in xamarin on visual studio. I can't load image from url. I try it in both way -

  1. Xaml code - <Image Source="https://xamarin.com/content/images/pages/forms/example-app.png" />

  2. Xaml code - <Image x:Name="myimg" />

Code behind:

myimg.Source = "https://xamarin.com/content/images/pages/forms/example-app.png";

I use visual studio enterprise version 2017... and android 4.4.2....

How to get OS version of mobile from C# in Xamarin Forms ?

$
0
0

Hi, I am using Xamarin forms for iOS and Android app development, I want to add the few values to insight related to mobile information. How to find the mobile platform and Mobile OS from C# code ?

Xamarin Forms, button needs two taps before anything happens

$
0
0

Hi All

I am having a bit of a strange problem, not sure if anyone else has had the same problem, when you initially tap the button, the button goes a darker shade (highlighted), you then have to tap it a second time before the code actually executes.

void AttendingClicked(object sender, System.EventArgs e)
{

        try
        {

        }
        catch (Exception ex)
        {

        }

    }
Viewing all 81910 articles
Browse latest View live


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