3

Is there a way to set a border radius on an Entry in Xamarin's XAML, or by using a custom renderer or something ?

Everything I've tried up to now has no effect, but for my application it would be really better if I had round borders.

Thank you in advance for your answer !

PS : I've checked this post but I've not found my answer there :)

Community
  • 1
  • 1
  • Well, as far as I remember I did something similar using two elements... You can try to use an entry without border and transparent background, and set a second element behind it which will render the border radius... – Kenzo_Gilead Mar 04 '17 at 16:31
  • Possible duplicate of [How to make Round corner Entry Control Xamarin.Forms](http://stackoverflow.com/questions/37584006/how-to-make-round-corner-entry-control-xamarin-forms) – Himanshu Dwivedi Mar 04 '17 at 17:26
  • Thank you @GileadKenzo, that's exactly what I've done with the answer of Alessandro Caliaro just below :) – Antoni Maniscalco Mar 06 '17 at 10:32
  • Wellcome, glad you get it. :) – Kenzo_Gilead Mar 06 '17 at 19:25

2 Answers2

3

I've posted this answer here too, but for convenience I'll just paste it below:

I'm not sure if there's something wrong with this approach or not, because it seems so simple but no one's suggesting it.

But I don't see why you can't just use a Frame with IsClippedToBounds set to true. That gives you a built-in corner radius, which you can then adjust as needed.

        <Grid>               
             <Frame
                   CornerRadius     ="20"
                   IsClippedToBounds="true">
                <Editor />
            </Frame>
         </Grid>

I'm currently using this solution and it works for me.

Le Mot Juiced
  • 3,761
  • 1
  • 26
  • 46
2

I think you can use a grid with 1 row and 1 column Inside the grid you can add your Entry and, for example, this control, in the same (the only) cell. You should have an Entry with rounded corners...

This is another useful control (XFShape). Create shapes content views from shared code for your mobile apps! For Android and iOS.

Alessandro Caliaro
  • 5,623
  • 7
  • 27
  • 52