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

Xamarin Forms Maps - MapSpan Zoom Level

$
0
0

Hi,

I am struggling with the zoom levels of the MapSpan object. I have used Xamarin.Forms.Maps for the display and Geolocation to track a device. As the location of the device updates, the map is re-centered around the device's current location.

The problem is I want to keep the current level of zoom by performing:

    var zoomLat = _map.VisibleRegion == null ? 6.0 : _map.VisibleRegion.LatitudeDegrees;
        var zoomLon = _map.VisibleRegion == null ? 6.0 : _map.VisibleRegion.LongitudeDegrees;
        var zoomRad = _map.VisibleRegion == null ? 6.0 : _map.VisibleRegion.Radius.Miles;

//Method number one of re-centering the map with current level of zoom
_map.MoveToRegion(new MapSpan(_mapViewModel.UserPosition, zoomLat, zoomLon));

//Method number two of re-centering the map with current level of zoom
_map.MoveToRegion(MapSpan.FromCenterAndRadius(_mapViewModel.UserPosition, Distance.FromMiles(zoomRad)));

The problem however is that with both methods the zoom level is just slightly out causing the map to zoom out over time. Is the any method for keeping the zoom level fixed?

I can also not just specify a rudimentary zoom level as I want the user to be able to pinch and zoom on the map application.

Any help regarding this problem will truly be appreciated.


Grial UI Kit for Xamarin Forms

$
0
0

Hi everybody! Just wanted to share with you our first Xamarin Forms User Interface Kit.

And hear what you think about it :)

Please check it out http://www.grialkit.com

Thanks everybody!

Xamarin Forms Cross Platform Audio File browser

WebView not working inside MasterDetailPage Page and IsVisible causing crashes.

$
0
0

Hello.

I followed this guide here to create a project that uses MasterDetailPage
https://www.syntaxismyui.com/xamarin-forms-masterdetail-page-navigation-recipe/

But my issue is now that WebViews aren't visible inside of the content pages, they are just blank. I've tried a lot of different WebView samples.
Meanwhile calling on IsVisible, either directly in XAML or the code-behind causes the MasterDetailPage to crash.

Should I consider using a different MasterDetailPage sample or is this an issue with MasterDetailPage in general?

Hide day in DatePicker

$
0
0

Hi, is there a way to hide the day field in a DatePicker? I tried using different values for the Format property but it doesn't seem to have any effect.

Is it possible to delay re-painting of the display until a series of changes to a page are all done?

$
0
0

Back in the days, before .Net, when developing Windows SDK applications, it was possible to stop a listbox from updating on screen whilst multiple changes were made to its content, then re-enable drawing of the listbox to show the final result. This was faster, but also reduced annoying scrolling etc on screen.

Is there a way of disabling and re-enabling painting in Xamarin.Forms?

I have some code where I replace one image by another (more accurately, I change the Source property of an Image to reference a different source) , but currently when that happens on Windows, there is flicker as if the old image were removed and the new image then added (the views to the right of the image move left, then move right again). Without switching to using absolute layouts, is there any way to prevent this flicker? For this particular case, it is when changing the Source property of an Image to use another image of the same size. Although a specific solution for this would be good, a generic solution would be great :-)

Many thanks,

John H.

Xamarin Forms - XAML preview

$
0
0

Hey everybody! We are about to release a Gorilla Player Beta,
if you didn't do it already, we would like you to join in :)

Check out super speed UI design with Xamarin Forms and Gorilla Player :)

By the way, we need a name for our new hairy buddy. Any idea?

Cheers!

Add a Xamarin.Forms Element to a UIView in a custom renderer

$
0
0

Hi!

Does anyone know if it's possible to add a Xamarin.Forms Element to a UIView in a custom renderer? I have tried Platform.CreateRenderer but it doesn't display anything for the Element.

The element is set in the custom Element from the PCL so it's not possible for me to create the UI with UIViews in the renderer.

Regards,
Kristofer


XF Android : Could not load assembly Microsoft.Windows.Design.Extensibility

$
0
0

Hello ,
I have update Xamarin.Forms to 2.0.0.6490,
But get this exception when compile:

Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Microsoft.Windows.Design.Extensibility, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile?
文件名:“Microsoft.Windows.Design.Extensibility.dll”
在 Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
在 Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
在 Xamarin.Android.Tasks.ResolveAssemblies.Execute() UWPTest.Droid

Use Xamarin.Forms 2.0.0.6484 not has this question.
What happened ? Need I references it to Android Project ?

Thanks.

PopToRootAsync in OnResume

$
0
0

Hello,

i would like to navigate to my root page when the app resumes.

On iOS i can use this in my App.cs:

protected override async void OnResume()
{
    await App.Current.MainPage.Navigation.PopToRootAsync ();
}

On Android (with AppCompat) this results in an error message:

java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1448)
at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1466)
at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:634)
at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:613)
at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.n_onStop(Native Method)
at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.onStop(FormsAppCompatActivity.java:110)
at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1212)
at android.app.Activity.performStop(Activity.java:5376)
at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3185)
at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3234)
at android.app.ActivityThread.access$1100(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1223)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)

What can i do to make this work?

Regards,
Dirk

Webview Post request windows phone 8.1

$
0
0

Hello friends,

I am trying to do a post request in web view, I am receiving a success response but in actual I am unable to login on webpage.

I have login page I don't want user to enter username and password so I am doing post request to login automatically. I am doing same in iOS and Android absolutely working fine on this platform but I guess Post request in web view for Windows phone 8.1 is failing here because after post request I am seeing the login page instead of Logged-in page. Here is code I am using for post request in wp8.1, The following code send request to Login page if the request is successful then session is established.

        string body = "Username=30001&Password=12345";
            string URLstring = string.Format(state.WebAppBaseUrl + state.LoginRelativePath);

            HttpRequestMessage request = new HttpRequestMessage( HttpMethod.Post, new Uri(URLstring));
            request.Content = new HttpStringContent(body);
            webview.NavigateWithHttpRequestMessage(request);

Here is response after above post request

After doing post request I am redirecting to home page

        private void WebView_NavigationCompleted(WebView sender, WebViewNavigationCompletedEventArgs args)
        { 
            if (args.IsSuccess == true)
            {
                 //success
                if (IsWebViewLoaded == 0)
                {

                    state.Flow = "1";
                    IsWebViewLoaded = 1;
                 string Url = state.WebAppBaseUrl + state.WorkFlowRelativePath + "WorkflowId=" + state.WorkFlowId;
                    webview.Navigate(new Uri(Url));
                }
                else if (IsWebViewLoaded == 1)
                {


                    ProgressGrid.Visibility = Visibility.Collapsed;
                }
            }
            else
            {
                //fail
            }

        }

Sqlite transaction timeout failure in Xamarin.Forms app running on iOS device

$
0
0

I have a Xamarin.Forms app being built for iOS and Android that uses sqlite for data storage. In the iOS version, we call directly into the sqlite APIs instead of using something like system.data.sqlite. We set all our read/write database connections to WAL journaling using PRAGMA journal_mode='WAL' and set a busy timeout of 10 seconds using sqlite3_busy_timeout(db, 10000);. But when running on the device, when two transactions overlap, we get instant failure (i.e. the statement fails with SQLITE_BUSY) with no timeout.

I've tried setting the busy timeout with the equivalent pragma statement, and I've tried retrieving both the journal mode and timeout values after setting them to confirm they're sticking. They are.

I've tried two main ways of debugging this.

The first is to build an updated sqlite version from source myself and link against it as described here. But the build process insists on linking against the sqlite version built into iOS. I tried changing the name of the sqlite3_libversion method to sqlite3_libversion_ot in my sqlite source in case it's finding duplicate names in my framework and the system's and preferring the system's, but when I call it I get a runtime exception of System.EntryPointNotFoundException: sqlite3_libversion_ot.

The second is to use the sqlite error log in the hope that it'll spit out either an explicit reason why it's not using its timeout or some other message about something funky with the database connection. But because sqlite3_config uses va_args, it's very difficult to call into it from C#. If anyone can show me how to set up the sqlite error log from C#, it would be much appreciated.

So the question: has anyone had similar issues with transaction timeouts with SQLite and Xamarin / Mono before? If not, can anyone help with either of the two debugging approaches mentioned, or suggest other ideas?

Deployment failed. Architecture not supported.

$
0
0

Hi

I am getting the below error while deploying..

The package does not support the device architecture (x86). You can change the supported architectures in the Android Build section of the Project Options.

Deployment failed. Architecture not supported.

SignaturePad

$
0
0

Since upgrading to the latest and greatest SignaturePad is no longer compatible, are there any other solutions or is there a plan to bring SignaturePad into the newer version.

is there a good solution for Display EMOJI in ASP.NET(Web),Xa.forms and Xamarin.Mac and GTK#

$
0
0

We are making a CRM with chat module using ASP.NET and Xamarin Studio, and have ASP.NET, Xamarin.Mac, Xamarin.Forms and GTK# platform,

How to make a good solution for Display EMOJI in all those platforms?

help! thank all guys very much! ~_~


Problem binding data across content pages on iOS Forms app.

$
0
0

I have a problem with binding across pages. (simplified) A project has a view model consisting of a static class with a single string property Name. Content Page1 is set as the BindingContext for the model. A label on Page1 has SetBinding set for Label.TextProperty in "one-way" mode in the hope that a change to the underlying string will cause the label text to be updated automatically. The handler for a button on Page1 instantiates content Page2 and sets the BindingContext to the same model before displaying the Page2 using navigation. In the constructor for Page2, an Entry field has SetBinding set for Entry.TextProperty in "one way to source" mode so that a text changed event handler (or similar) would update the view model. The "Back" button would return the user to Page1 with the newly entered value displayed on the label. Only it doesn't work. The label remains blank. Am I missing or overlooking something? Any known pitfalls I could check? Or is there a better way to implement there required cross-page functionality?

Seeing Beacons in the background on Android in a X.F PCL solution.

$
0
0

So its straight forward enough to monitor for beacons in the foreground in a PCL with the Androids MainActivity being the IBeaconConsumer.

But I'm not sure how to get background monitoring working, as when we did this in a Shared project the Android App derived from IBootstrapNotifier, but of course in a PCL the App is in Forms so I can't just go making an Android App file that derives from IBootstrapNotifier.

We're using the AltBeacon NuGet for Android as we're using generic beacons (well gimbals but as their security feature fills the bluetooth log on androids running less than 4.4.3 we're running them in generic mode)

Anyone have any ideas?

Cannot install any package

$
0
0

Dear all,

Forgive me if this is really a newbie question. I've started working with Xamarin and Xamarin.Forms. Now I'd like to try installing new packages but I cannot install almost any package on any platform.

My project is a plain Xamarin.Forms one, just created with the wizard, and I am trying, for example, to install log4net or Facebook into my Forms project Packages, or into the iOS one, I get errors:

Adding 'log4net 2.0.4' to TestProject.
Could not install package 'log4net 2.0.4'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Adding log4net...
Adding 'log4net 2.0.4' to TestProject.iOS.
Could not install package 'log4net 2.0.4'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.


Adding Facebook...
Adding 'Facebook 7.0.6' to TestProject.
Could not install package 'Facebook 7.0.6'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Adding Facebook...
Adding 'Facebook 7.0.6' to TestProject.iOS.
Could not install package 'Facebook 7.0.6'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

The Xamarin version I'm using follows. Some packages I can install in the Forms project are EntityFramework, Microsoft.Net.Http (which installs also some dependencies).

Am I missing something here?

Thanks for any help!

Xamarin Studio
Version 5.10.1 (build 6)
Installation UUID: 6ca49aa0-6464-4a7d-9494-5a28f687f520
Runtime:
    Mono 4.2.1 (explicit/6dd2d0d)
    GTK+ 2.24.23 (Raleigh theme)

    Package version: 402010102

Xamarin.Profiler
Not Installed

Xamarin.Android
Version: 6.0.0.34 (Business Edition)
Android SDK: /Users/sensei/Library/Developer/Xamarin/android-sdk-mac_x86
    Supported Android versions:
        2.3   (API level 10)
        4.0.3 (API level 15)
        4.4   (API level 19)
        6.0   (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Xamarin Android Player
Not Installed

Apple Developer Tools
Xcode 7.1.1 (9081)
Build 7B1005

Xamarin.Mac
Version: 2.4.0.109 (Business Edition)

Xamarin.iOS
Version: 9.2.1.54 (Business Edition)
Hash: eb4c1ef
Branch: master
Build date: 2015-12-01 02:12:30-0500

Build Information
Release ID: 510010006
Git revision: 0b60eecdb531933734519c13257d16a780274aab
Build date: 2015-12-04 20:28:20-05
Xamarin addins: 9876fd7c9837977178411ec7375b4352c0a0d6af
Build lane: monodevelop-lion-cycle6-baseline

Operating System
Mac OS X 10.11.1
Darwin Senseis-MacBook-Pro.local 15.0.0 Darwin Kernel Version 15.0.0
    Sat Sep 19 15:53:46 PDT 2015
    root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64

Xamarin.Forms 2.0 issues

$
0
0

I just recompiled my project with Xamarin.Forms 2.0 and found Application.Current.SavePropertiesAsync is not working as expected in "Release" mode.

I used the following code to save the login email

Application.Current.Properties ["LoginEmail"] = loginInfo.Email;
await Application.Current.SavePropertiesAsync ();

and then load it when the app starts.
if (Application.Current.Properties.ContainsKey ("LoginEmail")) {
c_email.Text = (string)Application.Current.Properties ["LoginEmail"];
}

But now, I cannot load the saved email any more. The strange thing is, it still works in debug mode. Can anyone help me out?. It will be a big headache for me to rollout an update.

Thanks.

Listview Page that functions like Android List Activity

$
0
0

Does anyone have a good example of using a page and having it function in a similar fashion to Android List Activities? Need to have a form use that as a "picker" rather than an actual picker and will have to do the same for some search pages. My first inclination is to pass a value to find the list of objects to be used as the picker list and then pass the selection using a MessagingCenter to get the data back to the calling page.

Viewing all 91519 articles
Browse latest View live


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