Forum General

Using fat borders around any view element

any2abraxasany2abraxas Member ✭✭

I have been reimplementing an existing solution in Xamarin forms. In this original solution one of the things i have to be able to do is draw borders around any kind of view element. These borders should also be able to have rounded borders. The thing is that these borders kan have any thickness, so a simple frame isn't going to cut it.

The best solution we have found so fa is a custom renderer for both IOS and android that works using a contentView. I have added the source code for these.

Now these borders seem to work pretty ok when handling small border thicknesses however whenever i make these bigger problems start to arise.

An example of the main problem:

  • Take a frame (or any other kind of view) with set width x and y
  • I apply a border of thickness 5
  • Now i would expect that the content in my frame (or any other kind of view) is bound bij the dimensions x-10 and y-10 (height/width - 2 * border thickness)

This however doesn't appear to be so in all of the cases.

I'm pretty new to xamarin and sincerely hope anyone can help me with this?
Thanks in advance


Sign In or Register to comment.