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

Replicating Android's "Secondary Order" drop-down ToolbarItem menu in iOS

$
0
0

Hello everyone!

I have been trying to replicate this:
htt ps://us.v-cdn.net/5019960/uploads/editor/j4/g4841e63uvo6.png
htt ps://us.v-cdn.net/5019960/uploads/editor/96/hkcgkiqwjoua.png

in IOS, in order for it to look like this:
htt ps://us.v-cdn.net/5019960/uploads/editor/3i/w4prr2qcfcsr.jpg

I came across this thread: htt ps://forums.xamarin.com/discussion/112957/content-page-secondary-toolbar-items-in-ios-same-as-android and he seems to have got an answer, but I have no idea how to implement what he has suggested.

Thank you so much for your time,
Daniel


Input required :"keystoreAlias"

$
0
0

I'm trying to successfully build and deploy my forms application to hockey app.I'm using the default Xamarin.Android definition. I have run a succesful build before but now i want to be able to try out the deployed application (from hockeyapp) on my mobile phone so i selected the "sign the apk" checkbox and now despite the fact that i have provided the path to the keystore file, i'm still getting the error message on my build "Input required: keystoreAlias". Do i have to generate a new custom keystore file?

ACR BLE project build issues

$
0
0

Hi Guys,

I seem to be having issues using the bluetoothle library as it seems to be showing a warning message on build.

Warning NU1701: Package 'Plugin.BluetoothLE 2.0.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. (NU1701)

Also when I try to build using an iPhone I get an error saying that its not compatible with my current SDK version 10.1 but certain features of bluetooth require version 11. I am assuming this is because Visual Studio seems to be loading it with the full .NET Framework version.

I have got the latest update on Visual Studio for Mac 2017 Community. I have also tried this on my updated VS 2017 and I get the same issue.

@AllanRitchie can you please shed some light on this issue and what I could be doing wrong.

Thanks

Entry loses focus when tapped

$
0
0

Help! The latest Android version seems to have some unwanted behaviour - Every time focus is put into an EntryCell or Entry, the keyboard pops up and loses focus on the entry cell. Has anybody else seen this behaviour?

How do I use IValueConverters?

$
0
0

I have created a converter which looks like this:

public class SecondsToHoursMinutesValueConverter 
    : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        var t = TimeSpan.FromSeconds((int)value);

        return string.Format("{0:D2} hours {1:D2} minutes", t.Hours, t.Minutes);
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}

Now I want to bind it with:

runtime.SetBinding(Label.TextProperty, new Binding("Runtime"), BindingMode.Default,
    new SecondsToHoursMinutesValueConverter(), null);

However, VS does not like it and says there is an error in that code:

Error 1 The type arguments for method 'Xamarin.Forms.BindableObjectExtensions.SetBinding(Xamarin.Forms.BindableObject, Xamarin.Forms.BindableProperty, System.Linq.Expressions.Expression<System.Func<TSource,object>>, Xamarin.Forms.BindingMode, Xamarin.Forms.IValueConverter, string)' cannot be inferred from the usage. Try specifying the type arguments explicitly. D:\git\Xam.Forms.Mvx\CoolBeans\CoolBeans\Pages\DetailedMoviePage.cs 101 13 CoolBeans

Xamarin Forms 2.5 and CreateFragment Extension.

$
0
0

Hello!

I have a question on the new Forms version in regards to how the fragment is created from the CreateFragment and CreateSupportFragment extension methods.

In the Xamarin.Forms.Platform.Android project in the AppCompat folder there is the PageExtensions.cs file. In this we can see the implementations for the EmbeddedSupportFragment and the EmbeddedFragment fragment classes. In my app, I'm seeing empty pages when I resume my app when I was last on one of my forms pages that I turned into a fragment, and I believe the cause is because the view for these fragments are passed into the fragment's constructors.

From what I know, derived fragment classes shouldn't create constructors because when the OS "resurrects" these fragments, it uses the parameter-less constructor, which in our case would make the ViewGroup empty.

I don't really post here much, so I this needs to be in a different thread please let me know. But I believe this may be an important issue for thos of us who would like to keep using this new api.

How to consume EDITOR text in xamarin.forms?

$
0
0

I have used Editor in my Xamarin.Forms project as:
var messageEditor = new Editor
{
Keyboard = Keyboard.Default,
HeightRequest = 100,
BackgroundColor = Color.FromHex("#f2f2f2"),
TextColor = Color.FromHex("#808080")
};

And I am using Crossmessaging plugin to capture the Editor text and send it as an Email. But while composing the email body, I am not able to consume the text entered in the Editor just as "messageEditor.Text". Any idea how can I retrieve the text entered in the Editor box ?

namespace name could not be found

$
0
0

Hello,

I'm new in mobile app development and I'm using Visual Studio Pro (Xamarin.Form). When I execute Android and UWP everything is fine but in iOS i will get this error
The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)

I already update the NuGet package but still the same error.

Thanks


iCloud file(text,pdf),Audio file is not getting attached in iOS on click in xamarin.forms (PCL)

Application size when published in AppStore is 2 times larger than size of .ipa in ad-hoc mode

$
0
0

Hello Team,

I have one issue.
IOS Application size when published in AppStore is 2 times larger than size of .ipa in ad-hoc mode
Actually when ipa is created the size is 32.2MB. But when I upload the ipa file to AppStore it is increase to 74.8MB.
Can you please tell me why the size increase of my app when it uploaded. Is there any solution that the size should remain same.

Please let me know the solution for the app size increase on app store.

Thanks In advance,
Rohini

Toolbar Placement for Android app in Xamarin.Forms

$
0
0

I know that it is common for Android devices to have its toolbars on top of the page, but I'm also curious if there is a way to set the Toolbar Placement to Bottom for Android app just like Windows Phone apps do. What would be recommended way to move the toolbar to the bottom of the Android app screen?

Button unnecessary height on Android Only

$
0
0

Good day
In Xamarin.Forms app the button has unwanted height. I had to have a custom renderer to get rid of the padding inside the button, but still there is the height issue.
Following is the how I am creating the button:
<StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="Start" Orientation="Horizontal"> <Button x:Name="btnFirst" Text="This is sample button" BackgroundColor="Red" TextColor="Yellow" HorizontalOptions="EndAndExpand" VerticalOptions="StartAndExpand" WidthRequest="200" /> </StackLayout>

The renderer is setting the padding of the button to zero like:

Control.SetPadding(0, 0, 0, 0);

And it looks like the following:

Where as I would like to have the button like:

Thus getting rid of the extra height at the bottom.

**Important: I do not want to hard-code the HeightRequest, because the text of the button will be dynamic, so it could be longer. **

How to write a unittest with Device.OnPlatform()

$
0
0

Hello I want to test a method on the pcl-part. The IOS-Part do other stuff than the android one.

For example the ios-part make a ModalPush and the android-part a normal one

How do you test such parts?

Error: Webservice works totally fine in Android, but crashes in the iOS- ipad .

$
0
0

Hello; I am trying to execute the following code by calling the OpenView() function in the page constructor, inorder to retrieve data from the webservice and fill it up in a picker called servicePicker via an arraylist called services ;

async void OpenView()
{
Uri requestUri = new Uri("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
dynamic dynamicJson = new ExpandoObject();

        try
        {
            dynamicJson.MaintenanceType = "emergency";
            dynamicJson.FacilitiesName = "";
            dynamicJson.Language = "en";

        string jsonData = "";
        jsonData = Newtonsoft.Json.JsonConvert.SerializeObject(dynamicJson);
        var objClint = new System.Net.Http.HttpClient();
        System.Net.Http.HttpResponseMessage respon = await objClint.PostAsync(requestUri, new StringContent(jsonData, System.Text.Encoding.UTF8, "application/json"));
        string responJsonText = await respon.Content.ReadAsStringAsync();
        RootObject rootObject = JsonConvert.DeserializeObject<RootObject>(responJsonText);


        for (int i = 0; i < rootObject.ServiceType.Count; i++)
        {
            services.Add(rootObject.ServiceType[i].Value);
        }
        servicePicker.ItemsSource = services;
        if (services.Count > 0)
        {
            Testing.IsRunning = false;
            Testing.IsVisible = false;
        }
        }
        catch (Exception ex)
        {
            DisplayAlert("Test", ex.ToString(), "OK");
        }
    }

This works totally fine in Android, but crashes in the iOS- ipad . The issue is making me crazy :( . Please help. The exception I get is System.ArgumentException: Value cannot be null.

Here are error details:
System.ArgumentNullException: Value cannot be null. Parameter name: method at System.Linq.Expressions.Expression.Call (System.Linq.Expressions.Expression instance, System.Reflection.MethodInfo method, System.Collections.Generic.IEnumerable1[T] arguments) [0x00111] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/MethodCallExpression.cs:1239 at System.Linq.Expressions.Expression.Call (System.Linq.Expressions.Expression instance, System.Reflection.MethodInfo method, System.Linq.Expressions.Expression[] arguments) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/MethodCallExpression.cs:1046 at System.Linq.Expressions.Expression.Call (System.Reflection.MethodInfo method, System.Linq.Expressions.Expression[] arguments) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/MethodCallExpression.cs:1001 at System.Dynamic.ExpandoObject+MetaExpando.BindSetMember (System.Dynamic.SetMemberBinder binder, System.Dynamic.DynamicMetaObject value) [0x00033] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/external/corefx/src/System.Linq.Expressions/src/System/Dynamic/ExpandoObject.cs:863 at System.Dynamic.SetMemberBinder.Bind (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args) [0x00035] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/external/corefx/src/System.Linq.Expressions/src/System/Dynamic/SetMemberBinder.cs:57 at System.Dynamic.DynamicMetaObjectBinder.Bind (System.Object[] args, System.Collections.ObjectModel.ReadOnlyCollection1[T] parameters, System.Linq.Expressions.LabelTarget returnLabel) [0x000c6] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/external/corefx/src/System.Linq.Expressions/src/System/Dynamic/DynamicMetaObjectBinder.cs:90 at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T] (System.Runtime.CompilerServices.CallSite1[T] site, System.Object[] args) [0x00019] in <773264786149499a986a13db6a7d46fe>:0 at System.Runtime.CompilerServices.CallSiteOps.Bind[T] (System.Runtime.CompilerServices.CallSiteBinder binder, System.Runtime.CompilerServices.CallSite1[T] site, System.Object[] args) [0x00000] in <773264786149499a986a13db6a7d46fe>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151 at System.Linq.Expressions.Interpreter.ExceptionHelpers.UnwrapAndRethrow (System.Reflection.TargetInvocationException exception) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs:174 at System.Linq.Expressions.Interpreter.MethodInfoCallInstruction.Run (System.Linq.Expressions.Interpreter.InterpretedFrame frame) [0x00035] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.cs:333 at System.Linq.Expressions.Interpreter.Interpreter.Run (System.Linq.Expressions.Interpreter.InterpretedFrame frame) [0x00015] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Interpreter.cs:63 at System.Linq.Expressions.Interpreter.LightLambda.Run3[T0,T1,T2,TRet] (T0 arg0, T1 arg1, T2 arg2) [0x00038] in <773264786149499a986a13db6a7d46fe>:0 at App1.SnapFix+d__31.MoveNext () [0x00031] in C:\Users\mjehangir\source\repos\App1\App1\App1\SnapFix.xaml.cs:199

xamarin forms set focus at last position for entry

$
0
0

Xamarin forms set focus at last position for entry


Xamarin Android can Support Sql Compact Edition.......?

$
0
0

I am new to Xamarin Android....
I try to use sql compact edition database i received the following error....

System.DLLNotFoundException: sqlceme35.dll....

i update my compact edition but still same error and i try to add the "sqlceme35.dll" reference system not allow to add......

plz suggest me something........

Is it possible to have a flyout menu over a MasterDetailPage in Tablets (Orientation Landscape) ?

$
0
0

Hi. I was wondering if it is possible to have a flyout menu over an MasterDetailPage for tablets.

Thanks

MPIN/Passcode for a login page.

$
0
0

I want to create an m-pin which will help a user to login without using id and password.
For example, there are such apps in which we have to log in with user-id and password only one time. After that, we can create a pin., and when next time we are going to open that app we can use this PIN.
Any One, Please help me.

Creating projects that only target older devices

$
0
0

I'm trying to create a new project that needs to target older devices (Android v4, API 15 - Ice Cream Sandwich).

Having read James Montemagno's "Mastering the Android Support Libraries" post, it's clear that I need to install Xamarin.Android.Support libraries v15 (to match the API version), however these do not seem to exist on nuget; the earliest version I can find is v19?

I also stumbled across a forum post stating that "You must set your target/compile version of your android projects to latest" - How does this apply to applications that only target old versions of android? I.E v4 / v5? I was under the impression that the version you target should be the version you compile with. Is this not correct?

ListView showing empty space issue in xamarin ios

$
0
0

Hi everyone, I have tried to design a page like chat application. In this on of page contain listview and at the bottom of the page contain entry is presented. I am using 'KEYBOARDOVERLAP' package for when the user clicks on entry automatically scroll the total content of the page. It's work perfectly but the problem is when I click on entry my page view is scrolled to top up to keyboard height but some part of listview showing empty space. when the keyboard is hidden, that space is removed automatically. How can I remove that space. Please suggest any idea.

Sample code:

samplepage.xaml:
 -----------------
               <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
        xmlns:local="clr-namespace:SampleKeyboardInput"
           x:Class="SampleKeyboardInput.SampleKeyboardInputPage">

            <StackLayout HorizontalOptions = "FillAndExpand" VerticalOptions="FillAndExpand">
            <ListView x:Name = "DummyListView" HorizontalOptions = "FillAndExpand" VerticalOptions = "FillAndExpand" ItemsSource = "{Binding data}">
            <ListView.ItemTemplate>
                     <DataTemplate>
                        <ViewCell>
                        <StackLayout HorizontalOptions = "FillAndExpand" VerticalOptions="FillAndExpand">
                            <Label Text="{Binding }">
                               </Label>
                        </StackLayout>
                             </ViewCell>
                   </DataTemplate>
            </ListView.ItemTemplate>
            </ListView>
           <Entry HeightRequest = "50" HorizontalOptions = "FillAndExpand" VerticalOptions = "EndAndExpand"></Entry>
       </StackLayout>       
        /ContentPage>

Viewing all 58056 articles
Browse latest View live


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