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

Create simple chat forum

$
0
0
Hi
I am relatively new to Xamarin.Forms
I would like to know how to go about creating a simple Chat forum/Discussion, amongst consultants. I've looked and only seem to come across broadcast messages.

Guidance on Best SkiaSharp Performance

$
0
0

@mattleibow We are creating a graphic-intensive Xamarin.Forms app that uses Skiasharp to create high resolution images for printing. We use low-level drawing, SVG, local and remote images, text with custom fonts, etc. to compose our final output. All of the work is done in the .Netstandard shared project.

Can you direct us to examples, articles, documentation, anything that can give us guidance for how to do this in the most performant way? Here are a few questions.

  1. Presently we have a class that does all the drawing and returns an SKBitmap as the result. While we can use the class and do the work on a background thread, the SKBitmap cannot be used by the UI thread. Can you point to an example of how to properly (i.e. the correct SkiaSharp syntax and functions) marshal the image from the background thread to an SKBitmap on the UI thread?
  2. Related to that, we stopped using the SKCanvasView for two reasons. First, it does not resize nicely within Xamarin.Forms containers, so creating an image with SkiaSharp and then displaying it in a Xamarin.Forms Image object is best because it automatically resizes, playing nicely with Xamarin.Forms containers. Second, our graphics are apparently complex enough, or we are drawing them wrongly, so drawing them in response to the PaintSurface event on the UI thread caused the app to freeze. We can't even display a simple wait animation. That's why we're trying to do all drawing on a background thread.
  3. Would we benefit from using a GRContext and doing all this drawing on the GPU? Does that free the UI thread so it can display a wait animation? I am new to this realm and can find no example code showing how to create and use a GRContext in the .Netstandard shared project. The SkiaSharpFormsDemo does not do anything with the GPU as far as I can tell.
  4. I have studied the SkiaSharpFormsDemo, and have read through dozens of forum posts and most of the issues on the SkiaSharp GitHub project, trying to glean some tips. You mention often that it is important to reuse SKPaint objects, SKTypeFace objects, etc. Would you recommend making them static members of our drawing class and just changing the values every time they are used? The SkiaSharpFormsDemo seems to create SKPaint objects as needed, or within a using block, but I can't find an example of how to properly reuse them.

Thank you so much for your help and all your hard work!

Swagger integration with xamarin forms

$
0
0

Hello there,

I need to use swagger api codes just like drag and drop in xamarin forms project but every time I use the code generated by swagger I have to do few changes regarding restsharp and stream's writer property not found in restsharp.portable nuget package.

Please help me with the best possible solutions to fix this.

Thanks in Advance.

Images from url not showing on android

$
0
0

Hey,

I am trying to show some images from my wordpress site in my app. Its working great on iOS but not working on android.
Images I am getting from one wordpress site and I cannot figure it out why its not working on android.

Code I am using to get and show images is from xamarin.com site:

var webImage = new Image { Source = ImageSource.FromUri(new Uri("https ://xamarin.com/content/images/pages/forms/example-appDOTpng")) };

If I use this link then picture shows on both platforms but if I use

var webImage = new Image { Source = ImageSource.FromUri(new Uri("https ://www.sportino-ma.com/wp-content/uploads/2015/11/19884496_436596000030267_1630323802236795993_n-e1499849630652-150x150DOTjpg")) };

it would not work. I have searched the web for solutions but without any success.

I hope that someone can help me.. Thanx..

P.S. - I'm trying to set image source with XAML too but with same result. (using binding imgUrl as source). Space in my links are because I cannot post links here

App displays URL images from other URLs than my own

$
0
0

I am unable to make the URL public, but I've pasted the full URL into my browser and can confirm the page is right - the image shows in the browser.

But... when I copy that exact URL into a Xamarin.Forms image, set as:

<Image 
    HorizontalOptions="FillAndExpand"
    VerticalOptions="FillAndExpand"
    Aspect="AspectFit">
    <Image.Source>
        <UriImageSource Uri="https://mydomain.com/images/doesntshow.jpg" 
            CacheValidity="3" 
            CachingEnabled="false"/>
    </Image.Source>
</Image>

The image simply will not show.

If I substitute the URL: "https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg" the image shows fine.

NOTE: There is 0 possibility the URL is incorrect or has an error because... I'm not typing it; I'm copying/pasting it and it's showing just fine in the browser, just not the Xamarin.Forms app.

I've not a clue as to what to look for. Does anyone else?

Sample ToDo - Downloaded - How do I execute

$
0
0

I have downloaded the sample ToDo List. There are many members in the folder. What member do I click to execute the sample?

I can not execute the sample of Hello, Android: Quickstart or Multiscreen

$
0
0

I have downloaded but Hello Android: Quickstart and Multiscreen. When I attempt to execute phoneword.sin I get message ONE OR MORE PROJECTS IN THESOLUTION WERE NOT LOADED CORRECTED. I get the same message from but the Quickstart and the Multiscreen Deep Dive. What must I do to get around this problem?

How to create a camera app in xamarin app

$
0
0

Suggest best ways to create a camera app, and best plugins available for using cama in xamarin forms cross platform app


Opening file from location: AppxManifest.xml failed with error: The system cannot find the path spec

$
0
0

I've created a bare-bones Xamarin app (with shared elements, but they're not doing anything yet). It builds and runs in debug mode just fine on UWP and Android (I don't have a Mac to build it for iOS). But I've had to move it to another drive - a simple copy of the whole project directory to the new location. Now the Android version builds and debugs ok, but the UWP version gives me the error:

DEP0700: Registration of the app failed. [0x80073CF0] error 0x80070003: Opening file from location: AppxManifest.xml failed with error: The system cannot find the path specified.

How can I find out what's missing and tell Visual Studio where to look for it? (The version in the original location still works fine, but I'll need to delete that when I get the version in the new location working.)

The name 'InitializeComponent' does not exist in the current context

$
0
0

This is really strange and inconsistent. Sometimes it runs fine and sometimes I get the following error

'The name 'InitializeComponent' does not exist in the current context'

There is absolutely no change in code and project settings. Just sometimes it runs and sometimes it throws this compilation error. How to resolve this?

Picker shows multiple times

$
0
0

if you have multiple pickers on a page like Picker 1, picker 2 ... when you click on picker 1 and select something it works fine, but if you click and select something from second picker the first picker shows by itself. it is happening in XF 3.4.0.1008975 but it is ok in XF version 3.1.0.583944.

Do we have any fixes on its way?

Getting last 4 characters from a string retrieved from a Database

$
0
0

I'm using Firebase Realtime Database and I'm getting a string from the database and displaying it in a view using XAML. In order to cut a string and get last 4 digits, I'd generally do

x:Name="string1"

x.xaml.xs

string1.Text.Substring(string1.Text.Length - 4)

but I'm getting string1 doesn't exist in the current context. Maybe it's because I have it inside a ListView and I'm binding string1?

`
<ListView.ItemTemplate>


<ViewCell.View>

                                    <Label x:Name="string1" VerticalTextAlignment="Center" Text="{Binding itemID}"/>
                                    <Label VerticalTextAlignment="Center" Text="{Binding item}" />

                            </ViewCell.View>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>`

Need help debugging random crashes in GridCalc.cs

$
0
0

Hi, it's been a year or so that im getting random crashes in GridCalc, totally fail to repro, making it impossible for me to avoid. It's just random, on both iOS and Android, whatever forms version, being on latest atm.
Even worse, I cant seem to match Xamarin open source code i can find in inet with stacktrace lines numbers.
If anyone could could give me a direction to dig in, would be grateful for any clue:

12-12 16:08:53.456 I/MonoDroid( 7446): UNHANDLED EXCEPTION:
Thread started: <Thread Pool> #13
12-12 16:08:53.776 I/MonoDroid( 7446): System.NullReferenceException: Object reference not set to an instance of an object.
12-12 16:08:53.777 I/MonoDroid( 7446):   at Xamarin.Forms.Grid.MeasureStarredRows () [0x0017c] in D:\a\1\s\Xamarin.Forms.Core\GridCalc.cs:530 
12-12 16:08:53.777 I/MonoDroid( 7446):   at Xamarin.Forms.Grid.MeasureAndContractStarredRows (System.Double width, System.Double height, System.Double totalStarsHeight) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\GridCalc.cs:403 
12-12 16:08:53.778 I/MonoDroid( 7446):   at Xamarin.Forms.Grid.MeasureGrid (System.Double width, System.Double height, System.Boolean requestSize) [0x00117] in D:\a\1\s\Xamarin.Forms.Core\GridCalc.cs:510 
12-12 16:08:53.778 I/MonoDroid( 7446):   at Xamarin.Forms.Grid.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x0002a] in D:\a\1\s\Xamarin.Forms.Core\GridCalc.cs:58 
12-12 16:08:53.778 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:760 
12-12 16:08:53.778 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:642 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:131 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:700 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) [0x00236] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:198 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) [0x00058] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:123 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.StackLayout.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00019] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:80 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:760 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:642 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:131 
12-12 16:08:53.780 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:700 
12-12 16:08:53.780 I/MonoDroid( 7446):   at Xamarin.Forms.StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) [0x00236] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:198 
12-12 16:08:53.783 I/MonoDroid( 7446):   at Xamarin.Forms.StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) [0x00058] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:123 
12-12 16:08:53.783 I/MonoDroid( 7446):   at Xamarin.Forms.StackLayout.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00019] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:80 
12-12 16:08:53.784 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:760 
12-12 16:08:53.784 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:642 
12-12 16:08:53.784 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:131 
12-12 16:08:53.784 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:700 
12-12 16:08:53.784 I/MonoDroid( 7446):   at Xamarin.Forms.ScrollView.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x0005d] in D:\a\1\s\Xamarin.Forms.Core\ScrollView.cs:233 
12-12 16:08:53.784 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:760 
12-12 16:08:53.784 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:642 
12-12 16:08:53.785 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:131 
12-12 16:08:53.785 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:700 
12-12 16:08:53.785 I/MonoDroid( 7446):   at Xamarin.Forms.TemplatedView.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x0003c] in D:\a\1\s\Xamarin.Forms.Core\TemplatedView.cs:39 
12-12 16:08:53.785 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:760 
12-12 16:08:53.785 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:642 
12-12 16:08:53.785 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:131 
12-12 16:08:53.786 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:700 
12-12 16:08:53.786 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion (Xamarin.Forms.VisualElement child, Xamarin.Forms.Rectangle region) [0x00110] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:165 
12-12 16:08:53.786 I/MonoDroid( 7446):   at Xamarin.Forms.AbsoluteLayout.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x00046] in D:\a\1\s\Xamarin.Forms.Core\AbsoluteLayout.cs:69 
12-12 16:08:53.787 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x0014b] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:263 
12-12 16:08:53.787 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.OnSizeAllocated (System.Double width, System.Double height) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:223 
12-12 16:08:53.787 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:798 
12-12 16:08:53.787 I/MonoDroid( 7446):   at Xamarin.Forms.Layout+<>c.<OnChildMeasureInvalidated>b__45_0 () [0x00080] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:380 
12-12 16:08:53.787 I/MonoDroid( 7446):   at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <ad2f15102b3a4d36b40e9b0cbc11c376>:0 
12-12 16:08:53.788 I/MonoDroid( 7446):   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <ad2f15102b3a4d36b40e9b0cbc11c376>:0 

Does have visual studio 2017 preview for xaml file?

$
0
0

Is there preview for xaml file by using visual studio 2017 like as WPF?

how to turn on/off OneSignal push notification

$
0
0

Hi xamarin forum

I have implemented OneSignal for push notification but I want to have a turn on off notification with a push of toggle button, How can I acheive it


app crash by editor control : focus search returned a view that wasn't able to take focus!

$
0
0

xamarin forms standard

look like a bug to me and I wonder how to bypass that..

[1]
on some devices the app crash when editor control got focus right after showing the keyboard.
[2]
(on my device) crashes after the clicking the done/next button when on landscape mode.
the error log in bellow.

so for [2] I tried to bypass that by:
having the editor int a frame parent control as so:

< Frame x:Name="frameEditor" IsTabStop="True" >
<Editor Margin="10"
x:Name="txtMemoriam"
HorizontalOptions="FillAndExpand"
AutoSize="TextChanges"
Placeholder="Memoriam"
Parent="frameEditor"

                        Completed="TxtMemoriam_Completed"
                        Focused="TxtMemoriam_Focused"

                        ></Editor>
                    </Frame>

so now: on landscape mode the "done" button change to "next" control...
and apparently, its give focus to DatePicker control (open the datepicker)... (it's unexpected Behavior but it prevents it from crashing...)

for the first issue, I have tried to set focus.. but i dont yet know if its working - cause its not crashing on my device (got the report from google play)..

private void TxtMemoriam_Completed(object sender, EventArgs e)
{
//txtMemoriam.Unfocus();
//frameEditor.Focus();
Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
{
Task.Delay(1).ContinueWith(x => { this.txtMemoriam.Focus(); });
Task.Delay(10).ContinueWith(x => { this.txtMemoriam.Focus(); });
Task.Delay(100).ContinueWith(x => { this.txtMemoriam.Focus(); });
Task.Delay(1000).ContinueWith(x => { this.txtMemoriam.Focus(); });
});
}

    private void TxtMemoriam_Focused(object sender, Xamarin.Forms.FocusEventArgs e)
    {
        this.txtMemoriam.Focus();

        Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
        {
            Task.Delay(1).ContinueWith(x => { this.txtMemoriam.Focus(); });           
            Task.Delay(10).ContinueWith(x => { this.txtMemoriam.Focus(); });
            Task.Delay(100).ContinueWith(x => { this.txtMemoriam.Focus(); });
            Task.Delay(1000).ContinueWith(x => { this.txtMemoriam.Focus(); });
        });


    }

Issue: java.lang.IllegalStateException: focus search returned a view that wasn't able to take focus!

FATAL EXCEPTION: main
Process: com.shaot.nosafot, PID: 14496
java.lang.IllegalStateException: focus search returned a view that wasn't able to take focus!
at android.widget.TextView.onKeyUp(TextView.java:6674)
at android.view.KeyEvent.dispatch(KeyEvent.java:2766)
at android.view.View.dispatchKeyEvent(View.java:9948)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:391)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:439)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1861)
at android.support.v4.view.KeyEventDispatcher.activitySuperDispatchKeyEventPre28(KeyEventDispatcher.java:130)
at android.support.v4.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:87)
at android.support.v4.app.SupportActivity.dispatchKeyEvent(ComponentActivity.java:126)
at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:535)
at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
at android.support.v7.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:2533)
at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:353)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4736)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4707)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4244)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4297)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4263)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4390)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4271)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4447)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4244)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4297)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4263)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4271)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4244)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6671)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6645)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6606)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3915)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6524)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)

Height of a WebView

$
0
0

I have a StackLayout with a WebView followed by some other controls. The WebView should be as high as its contents.

Unfortunately the WebView doesn't occupy any space at all unless I set its HeightRequest.

For Android I found this SO question which uses the ViewTreeObserver. I tried that in a custom renderer and I do get a height at some point in time, but when I tried to set the Layout of the WebView, then the controls below it will not move down. It I call ForceLayout() on the StackLayout, then the method is called recursively (even though I removed the PreDraw handler already).

private void ViewTreeObserver_PreDraw(object sender, ViewTreeObserver.PreDrawEventArgs e)
{
    var height = Control.ContentHeight;
    if(height > 0 && height != Element.Height && Element.HeightRequest <= 0)
    {
        Control.ViewTreeObserver.PreDraw -= ViewTreeObserver_PreDraw;
        Element.Layout(new Rectangle(Element.X, Element.Y, Element.Width, height));
        ((StackLayout)Element.Parent).ForceLayout();
    }
}

How can I set the Height of the WebView to be as high as its content on Android and iOS?

Xamarin.Forms *needs* a hot reload system

$
0
0

Flutter is winning the hearts and minds of developers. I can see there is already jobs opening asking for flutter knowledge. Everywhere I read about flutter, people praise one functionality: "hot reload". I tested it and it is really nice. The thing is, flutter does not need it as much as XF. On flutter, things look the same on both devices so you do not spend so much time doing micro adjustments to the UI as on XF. The thing, I think, is that people learning need to see the changes they make to understand and learn. A person that does not know xaml will have a hard time even doing basic things look half decent. An experienced developer will have a hard time making things look exactly how he wants. It is possible but takes a lot of time.

I know about LiveXAML (http://www.livexaml.com/), I use it and it mostly works but it is not free. I know about XAMLator (https://github.com/ylatuya/XAMLator) and HotReload (https://github.com/AndreiMisiukevich/HotReload) but one only works on mac and the other I could not make work on android emulators. So, if this amazing developers are doing it, it is possible.

I think the most important thing for this feature is to be able to edit xaml on VS and see the change on emulators (android and iOS). It would be amazing if it could reload code changes too but only xaml will be a good start. It would be nice too if it could work without Visual Studio too, so I can edit .xaml files on VSCode and see the changes on my running app. This would make things so much better for experienced developers and for newcomers.

So my question is: when will Xamarin.Forms have an official hot reload system?

Is there a tinder-like interface available for Xamarin Forms that runs on IOS/Android/Windows Phone?

Xamarin forms Push notification

$
0
0

I want to add push notification in my xamarin forms project. Which method is the best option to implement push notification.

Viewing all 91519 articles
Browse latest View live


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