Menu

[FIX] CornerRadius for custom DPFButtons working

Diego
2013-08-22
2013-08-22
  • Diego

    Diego - 2013-08-22

    In DPF.iOS.UIButton.pas file, you have to add the line:

    FUIButton.layer.setCornerRadius(CornerRadius);
    

    before the line:

    AddSubView( Self, ParentControl );
    

    in procedure TDPFButton.Loaded;

    This way, if you are using: btCustom as ButtonType, you can assign any value to CornerRadius property and you will get the rounded button corner.

    I hope it helps!

     

    Last edit: Diego 2013-08-22
    • Babak Yaghoobi

      Babak Yaghoobi - 2013-08-22

      Hi, Diego

      Thank you for info.
      You can use CornerRadius property, I will fixed a minor bug in this property.

      Regards

       
      • Diego

        Diego - 2013-08-22

        Hi Babak:

        The line I added already takes the value from CornerRadius property. If you put 0 in CornerRadius in DesignTime, you get a perfect rectangle button, but if you set a value (5 for example), the rectangle will have rounded corners.

        I also tried to set the border line in the custom button with the layer.setBorderColor, but the color is a TPointer and I had not time to investigate how to assign it.

        Greetings

         
  • Babak Yaghoobi

    Babak Yaghoobi - 2013-08-22

    Hi Diego

    Download latest source from [code] section and see [Buttons] demo,

    Regards

     

    Related

    Code: code

  • Diego

    Diego - 2013-08-22

    I see you have fixed it at BaseControl level...

    Great work and thanks once more!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.