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

Geolocator gps code getting error when select ios project.

$
0
0

Hi, i am using Geolocator and i am gatting Latitute and Longitude for android But when i select ios project i am gatting error on timeoutMilliseconds->(the best overload for 'GetpositionAsync' does not have a parameter name 'timeoutMilliseconds ')
this is my code

async void Handle_Clicked(object sender, System.EventArgs e)
{
var locator = CrossGeolocator.Current;
locator.DesiredAccuracy = 50;
var position = await locator.GetPositionAsync(timeoutMilliseconds: 10000);
logi.Text = position.Latitude.ToString();
lati.Text = position.Longitude.ToString();
}

note-> it is working properly in android put when i select ios project i am gating this error message .

plese help me


iOS Icon Madness! Can't submit app

$
0
0

So I have seen lots of posts regarding issues with icons and app submission to the App Store. None of them seems to resolve my issue. I have tried both the Asset Catalog and info.plist methods and both fail.

  1. Asset Catalog - Gets an error that the 57x57 and 72x72 icon is missing. There are not spots for that in the asset catalog. I tried to hack the project file and catalog to include the files but no luck.
  2. info.plist - This hack allows the app to be submitted, however it gets rejected during processing. The error is: "Missing Asset Catalog - Your app is missing the asset catalog file in 'MineChat.iOS.app'"

So I cannot figure out how to get this app submitted. I am using Visual Studio 2017 on Windows and using current Stable channel. Any ideas here?

Thanks!

Using Google Maps for iOS on Xamarin Forms

$
0
0

Okay, I have this app that I need to render Google Maps on both iOS and Android. Xamarin.Forms.Maps renders its native maps based on the OS used by the device e.g. Google Maps for Android and MapKit for iOS which makes it easier for the Android to have Google Maps of course. What I want to achieve here is to also have Google Maps for iOS since the main map that we are using is Google Maps. How can I possibly be able to achieve this?

Thanks in advance.

Android Application minimize issue

$
0
0

I have developed an Xamarin forms application. In Android devices Lenovo K6(v7.0) and Nexus 6 (v7.1.1), when the app is minimized and opened by clicking the app icon the opening page of the application is reset to default instead of showing the part in the page where the user has minimized the application. But, when the app is minimized and re-opened using the recent opened tabs it is resumed correctly.

This problem arises only in the mentioned two devices in all other devices the page is resumed from where it is minimized when the user re-opens the application on using both recent tabs or App icon click. If close application then reopen it and application start from Splash screen. In above scenario, app start with home page and reset as default launch. I have started download in my app and progressing the download. I have minimized the app and click app icon from installed app in device. Now, progress is reset and file stay as download me.

Please suggest on this to resolve it.

Regards,

Cheran

360 images in Xamarin Forms

$
0
0

Hi mates,

I'm checking the viability of ussing a 360 image in Xamarin Forms. I have been researching but I haven't found any component so I'm very frustrated.

I have seen this github repo (Github Xplat GoogleVR) but I don't know if it's valid because the GoogleVR target is too old.

Have someone any experience in this topic? Exists any 360 viewer in Xamarin Forms?

Thank you sou much.

How to make the list on the right

$
0
0

help me
How to make the list on the right

How to fetch Copyright and Version Number?

$
0
0

I have an application to show App details(Version,Build and copyright info)-
so how to get Copyright Information,Version Number and Build number in code.

    public string GetVersion()
            {
                var context = Forms.Context;
                return context.PackageManager.GetPackageInfo(context.PackageName, 0).VersionName;
            }

using this code I found the version number,but how to get build number and copyright info?

List again starting from top when load more items in UWP

$
0
0

Dears,

In my xamarin forms project, I am listing 20 items initially on my ui. After reaching the bottom the next 20 items are loading. This will continue whenever reaching the bottom of the list.

My problem is on UWP; In UWP when reaching the bottom of the list the entire list gets refreshed and again starting from the top. No issues for the same feature in android project.

Is there any solution for this issue?
Thanks in advance :)


UWP splashscreen not displaying in fullscreen

$
0
0

Dears,

My UWP splash screen is like below, It is not covering the entire screen.

Here is the screenshot of my uwp app Package.appxmanifest. Here I am selecting my splash screens.

I need a full-screen splash, please suggest a solution.
Thanks in advance :)

Newtonsoft JSON / Prism

$
0
0

So trying to do multiple HTTP requests and have a callback for each successful request.
My code looks like follows in the callback:
var locationResponse = JsonConvert.DeserializeObject(data, typeof(LocationResponse)); _eventAggregator.GetEvent<PlacesEvent>().Publish((LocationResponse) locationResponse);
The first callback response works fine and the eventAggregator works fine sending the data. But when the second callback is called the eventAggregator somehow fires the event before the data is serialized. I tried to run a Task.Delay(2000) between the deserialization and the eventAggregator callback which works fine.
I do not see what I am missing here?

Thanks in advance.

Aspect Ratio on ImageCropper

$
0
0

Hello!

How can i set a custom aspect ratio when using the Xam.Plugin.ImageCropper plugin?

in iOS i have the custom renderer where there are some options, i want to set aspect ration of "9 : 16" but this doesn't appear in the list:

               TOCropViewController picker = new TOCropViewController(image);

                picker.AspectRatioLockEnabled = true;
                picker.AspectRatioPickerButtonHidden = false;
                picker.AspectRatioPreset = TOCropViewControllerAspectRatioPreset.Square;

TOCropViewControllerAspectRatioPreset.TOCropViewControllerAspectRatioPreset16x9 exists but not 9x16.

There is an option for Custom, but I can't see how to fix that to 9x16.

Pushasync is not supported globally on android please use a navigation page.

$
0
0

Hi,
I have got the following code:

listView.ItemTapped += async (sender, e) =>{
       ARPage arPage = new ARPage(e.Item.ToString());
       await Navigation.PushAsync(arPage);
      ((ListView)sender).SelectedItem = null;
 };

After running I got the error:
Pushasync is not supported globally on android please use a navigation page.

Any idea that can help me out. Thanks

How to create a custom ButtonRenderer on Android that changes the button style?

$
0
0

Hey,

I have a custom button (which I called ColoredButton) which should be rendered with a different AppCompat Style on Android. So I created a custom renderer:

[assembly: ExportRenderer(typeof(ColoredButton), typeof(ColoredButtonRenderer))]
namespace MyApp.Droid.Controls
{
    class ColoredButtonRenderer : Xamarin.Forms.Platform.Android.AppCompat.ButtonRenderer
    {
        public ColoredButtonRenderer(Context context) : base(context)
        {
        }

        protected override AppCompatButton CreateNativeControl()
        {
            return new AppCompatButton(new ContextThemeWrapper(Context, Resource.Style.Widget_AppCompat_Button_Colored));
        }
    }
}

But it does not work. The buttons are shown with the standard style, not with Resource.Style.Widget_AppCompat_Button_Colored.

Anyone knows why?

Thanks!
Nathan

Entry field size in a grid

$
0
0

I am using a two column grid to layout my form. The columns are defined as 20% and 80%. I have an entry field in the 80% side, and am trying to control the width using the WidthRequest property. The entry fields does not respect this size attribute. It fills the cell in the grid. How can I make this work?

     <Entry Grid.Row="3" Grid.Column="1"  Style="{StaticResource EntryField}"  WidthRequest="300" Text="{Binding City}"/>

Trying to achieve:
Name Dave
Address 123 North st.
City LA

Urgent: MpMoviePlayerController not playing the video after latest Xamarin.IOS update

$
0
0

Hi All,
The following code in Xamarin IOS was working fine prior to the Xamarin IOS update to v2.0.50727

This is the code in a custom renderer in a Xamarin Forms app

     class WatchVideoRenderer : PageRenderer
    {
        MPMoviePlayerController moviePlayer;

        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            var url =  new NSUrl("http://192.168.12.4:8085/MediaUploads/1/211/520140731170618/DPM202.mp4");
            moviePlayer = new MPMoviePlayerController();
            moviePlayer.ContentUrl = url;
            moviePlayer.View.Frame = new CGRect((float)((NativeView.Bounds.Width - 600) / 2), (float)((NativeView.Bounds.Height - 450) / 2), 600, 400);

            MPMoviePlayerController.Notifications.ObserveLoadStateDidChange(OnLoadStateChanged);
            MPMoviePlayerController.Notifications.ObservePlaybackDidFinish(OnPlaybackComplete);

            View.AddSubview(moviePlayer.View);

            moviePlayer.PrepareToPlay();
            moviePlayer.ShouldAutoplay = true;
            moviePlayer.Play();
        }

        private void OnLoadStateChanged(object sender, NSNotificationEventArgs e)
        {
            if (moviePlayer.LoadState == MPMovieLoadState.Playable)
            {

            }
        }

        private void OnPlaybackComplete(object sender, MPMoviePlayerFinishedEventArgs e)
        {

        }
    }

As i said this was working till day before yesterday, after which I installed 2 updates on Xamarin.IOS & this is now failing. All i see is a black canvas & the video never loads.
No notifications from the MPMoviePlayerController are ever raised.
There is a release of this app scheduled for next week & this last minute bug is causing me headaches. Any help is really appreciated.

Thanks
Supreet


Looking for Signature Pad

$
0
0

Need to implement a signature pad into a xamarin forms app

I see there is Xamarin.Controls.SignaturePad.Forms but I cant find any sample on how to implement it in a PCL project

Any help would be appreciated

Mike

How does one create a Solution with multiple shared/portable projects inside?

$
0
0

So I have been trying to structure my app to be more like some of the "finished" sample projects. In particular I have heard that the Xamarin Evolve app has been created very well. SO I am trying to replicated it's structure as much as possible.
https://github.com/xamarinhq/app-evolve

But I can not figure out how to add multiple projects into my solution. I have tried a few things. FWI I am working with a PCL project. I started this project before the nixed that structure

  1. Right click, Add, New project, Xamarin forms. This created a .Net cross platform app, to do this I need to create at least one other project (Android/ios/windows) I do this then delete the mobile project. But this has problems and I dont think is the correct way of doing it.

  2. Right click, Add, Existing project. and from here I tried
    2A. I tried adding directly from XamarinEvolve. This messed everything up as the file names were all funky
    2B. I pulled the start to my PCL Project from my Source Control and tried modifying ti and sticking it it. I sort of got it working but the namespaces got all funky.

I just feel like there is a super simple way to do this, but my web searching as turned up diddly squat.

The type or namespace name 'ExamplePage' does not exist in the namespace 'Example'

$
0
0

Hello all,
I got a sample project online which is in Xamarin.Forms. I have changed the solution name, project name, and the namespaces. After building the Android project, I got the error:
Error CS0234: The type or namespace name 'ExamplePage' does not exist in the namespace 'Example' (are you missing an assembly reference?) (CS0234) (Example.Droid)

The change has been done everywhere except in the Resource.Designer.cs file, which is automatically generated. Please help me why I am getting this error although I have manually changed everything. Thanks

Drawing on photo and saving it

$
0
0

I'm using SkiaSharp to create canvas on which i can draw by touch, on another page i can make photo. I can send this photo as ImageSource to canvasPage and my question is:
Can i somehow make canvas displaying this photo so i can draw on it and then i save it to photo gallery (or even to memory of device), drawing on photo is my biggest problem here.

Animate StackLayout to left and right

$
0
0

Hi All,

I have created a stack layout with 3 children(stack layouts) as shown in the attached image file. I have to animate the main layout t left or right according to the button click.

If I click to right button, The middle part should move towards right and left part will be displayed with animation and vice versa.

How can I do that?

Please Help

Viewing all 58056 articles
Browse latest View live


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