Circled Label Xamarin Forms

前端 未结 1 1129
一个人的身影
一个人的身影 2021-01-16 05:35

What I want to Achieve:

A seen in the below screenshot there is a label with a hole number, I want to create a circle around this label,how would I go about achievi

1条回答
  •  孤城傲影
    2021-01-16 05:59

    On the following link you will find the code and video for a RoundedBoxView (half way down the page).

    http://forums.xamarin.com/discussion/17792/video-on-making-custom-renderers

    If you create this within your project you can then do the following to create your rounded box label:-

    *) Grid as the outer control.

    *) Create a RoundedBoxView as a child of the Grid to create your circle - You could either specify fixed width/height on the grid outer control to know what value to specify the RoundedBoxView's CornerRadius property, or alternatively hook into the SizeChanged event handler to set the values.

    *) Create a Label control also as a child of the Grid control, and center the position of it.

    You can then create your Hole text in a Label within a horizontal StackLayout and then add the above in to create the effect you desire.

    0 讨论(0)
提交回复
热议问题