Forum Xamarin.Forms


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Forms9Patch: Simplify multi-device image management in your PCL Xamarin.Forms mobile apps



  • IcolinoIcolino Member ✭✭

    Image doesn't contain a definition of TintIcon, same as with padding. That seems to be the problem why Icon doesn't show up.

    One more thing I am using a c# ImageMultiResourceExtension for the xaml to find source image. So perhaps because of that xaml functions properly.

    There shouldn't be any problem from the directory, since that is what I am using for resource in Xaml.
    Contents, all resources are embeded :


    Thanks for taking the time to respond.

  • BuildCalcBuildCalc USMember ✭✭✭

    My fault. Remove TintColor from the image completely. Then, set button.TintIcon=false;

  • BuildCalcBuildCalc USMember ✭✭✭

    Also, no need for the 9 in the file names ... unless they are really 9-patch images.

  • IcolinoIcolino Member ✭✭
    edited March 2019

    Yeap, it was necessary to set button.TintIcon to false. The images are 9-patch. Thanks again. C# works as well now.
    One more thing I have opened a stackoverflow question at the same time for the same question. So if you don't mind I will user your answer there to close it. Unless you want to do it yourself.

    Here it is.

  • mabdollahiaslmabdollahiasl Member ✭✭


    Hi, I use form9patch, it is grate.
    but I have a problem with BubblePopup , the pointer just point to left and right, and never point to top or bottom when I set pointer direction to vertical, it just the popup on then center of screen.
    is it a normal behavior or its a bug.

  • BuildCalcBuildCalc USMember ✭✭✭


    There's a good chance this is normal behavior. In addition to the location of the VisualElement used for the BubblePopup.Target, rendering of the pointer depends on the values of the following BubblePopup properties:

    • Margin
    • Padding
    • HasShadow
    • PointerLength
    • PreferredPointerDirection
    • PointerDirection
    • WidthRequest
    • HeightRequest
    • HorizontalOptions
    • VerticalOptions

    ... as well as the measured size of the VisualElement used for the BubblePopup.Content property which can depend on a number of factors, including the size of its children and the values of its properties, such as:

    • Margin
    • WidthRequest
    • HeightRequest

    If, after taking into account all of the above, there are multiple directions, specified by PreferredPointerDirection, that have room for the BubblePopup and its pointer, BubblePopup will display the pointer in the direction with the most room.

    However, if, after taking into account all of the above, there is not enough room for the pointer in any of the directions specified by PreferredPointerDirection, BubblePopup will try to render a pointer in one of the directions specified by PointerDirection. If it cannot do that as well, BubblePopup will gracefully fail by presenting the content in a ModalPopup.

    In addition to giving the above properties a try, I would suggest taking a look at the Forms9PatchDemo BubblePopupTestPage to see some of this in action. If modifying those properties and the example doesn't help and you're still suspecting a bug, please go to the Forms9Patch repo and file a bug report. Don't forget to include an demo app the shows the issue you're seeing.

  • mabdollahiaslmabdollahiasl Member ✭✭

    I Solved the problem, The problem was related to the content of the Popup. I used a grid with auto size in column and row, I set the exact size instead of auto and my problem solved, thanks.

Sign In or Register to comment.