JohnHardman

Badges

500 Likes2500 Comments250 Answers250 LikesSecond Anniversary100 Answers1000 Comments50 Answers100 Likes25 Answers500 CommentsFirst Anniversary25 Likes5 Answers100 CommentsFirst AnswerPhotogenic5 Likes10 CommentsName DropperFirst Comment

About

Username
JohnHardman
Location
GB
Joined
Visits
4,108
Last Active
Roles
University
Points
3,792
Badges
21

JohnHardman ✭✭✭✭✭

About

Username
JohnHardman
Location
GB
Joined
Visits
4,108
Last Active
Roles
University
Points
3,792
Badges
21
  • Re: How to make a Cross Platform Bubble Control? (example of request provided)

    The starting point is that you need an Image for the bubble itself. The Image will be square, using a .png with transparent pixels filling between the circumference of the circle and the bounding square, so that when displayed the user just sees the circular bit.

    Use a GestureRecognizer to detect taps on the Image. If you are ok with a tap between the edge of the circle and the edge of the square Image being accepted as a tap, nothing more needs to be done. However, if you don't want taps outside the edge of the circle being accepted, you will need to get the position at which the tap was done and check whether it is within the circle.

    For positioning the Image, you will probably want to use either a RelativeLayout or AbsoluteLayout. Whichever is used, what wants to be the page content gets added to the Layout, then the Image for the bubble gets added on top.

    For dragging the bubble around, you can either do this with or without custom renderers. If doing it without custom renderers, you will probably want to use MR.Gestures .

  • Re: Get Size of autosize Label placed into a grid

    @LalaRiver said:
    Thank you. OnChildMeasureInvalidated did the job for me.
    I already have my own autosize mechanism on all 3 platforms, but thank you for the link anyways.

    If you have code to adjust the FontSize of a Label to fit the available space on UWP, could you share that please, either here or by submitting to https://github.com/FormsCommunityToolkit/FormsCommunityToolkit

  • Re: How to avoid the flickering effect when pushing a new page

    @MT_WSM - Have you done the basic optimisation stuff? See

    Have you profiled your app to see whether the time is spent constructing the page's UI hierarchy or spent rendering it? Also, have you made sure that you are not setting a ContentPage's Content property, and after that then modifying the page layout? (make setting the Content property the last UI change you make before initial display). Have you removed any unnecessary bindings?

    If the time is spent building the UI hierarchy, you can reorganise code to do most of the work on a non-UI thread and just hook it up on the UI thread at the last moment (I do this on some pages). Some people also cache pages, so that they don't have to be rebuilt on subsequent use, although others (me included) have seen problems result from doing this. I have structured my code so that I can easily re-enable use of page caching when problems with it are resolved.

    If the time is spent on the rendering the page, it's going to be a case of simplifying the page (at least when it first appears), optimising renderers, and possibly switching particularly problematic pages to native.

    Although I have done various things to optimise page construction, I still see a delay on some pages because of the rendering time. I'll be re-factoring those pages when functionality is complete, possibly switching those pages to native.

    One final thing - if your app pages have a background color other than white, change the NavigationPage background color to that same color. It doesn't reduce the delay, but it makes it marginally less obvious.

  • Re: How to format for currency in edit text for user input?

    @Longwashere - There are plenty of answers to this in the forum already. One example is https://forums.xamarin.com/discussion/103969/masked-entry-behaviour-field-level-masking-validation

  • Re: PostAsync is not working properly, whenever executed it gives exception in the catch.

    @MuhammadHamza.5351 - Post the details of the exception.

    Also, be aware that your use of ConfigureAwait(false) is likely to cause problems when you call DisplayAlert (or otherwise interact with the UI thread).