Label Padding

Is it possible to add padding on a Label? If not, what's a workaround if I want some space between the text and the edge of the label?


Best Answer


  • MarkMadlangbayanMarkMadlangbayan USUniversity ✭✭


  • ChrisChanChrisChan MYMember

    not really work, not all text is left align. it put into grid .:(

  • ThomasBurkhartThomasBurkhart DEMember ✭✭✭✭

    You can add a Frame around the Label. It has Padding properties

  • NMackayNMackay GBInsider, University mod

    The latest pre-release of Forms includes margin support, worth investigating.


    Adding margin support is intended to allow users to reduce the overall depth of their layout hierarchies by allowing more complex layouts with fewer wrapping views.
    public Thickness Margin { get; set; }

  • OnurHazarOnurHazar USUniversity ✭✭

    @LuckyDay Thanks, it works. Do we need to wrap up in <ContentView.Content> ?

  • JohnHardmanJohnHardman GBUniversity mod
    edited September 2016

    @onur.hazar - Whilst using ContentView used to be how this was done (without using a custom renderer anyway), it is now possible to use the Margin property on Label, which is more efficient than wrapping in a ContentView.

  • OnurHazarOnurHazar USUniversity ✭✭

    @JohnHardman Thanks!

  • BhaurajBiradar.9064BhaurajBiradar.9064 USMember ✭✭✭
    edited November 2017

    Try below too,

    internal class DemoLabelRenderer : LabelRenderer
        private UIEdgeInsets EdgeInsets { get; set; }
        public override void Draw(CGRect rect)
            EdgeInsets = new UIEdgeInsets(0, 2, 0, 2);
Sign In or Register to comment.