Padding not working on UIButton with Pixate Freestyle

54 Views Asked by At

I'm completely new to Pixate Freestyle in Xcode and while experimenting with it, I couldn't get any padding to work on a UIButton. Other properties like background-color, border and border-radius are working but the padding doesn't seem to do anything.

Is there anything I have to do in order to add padding to a button ? Or is it that buttons simply cannot be padded?

I'm using Xcode 7.0.1 and the latest version of PixateFreestyle.

Thanks! :)

1

There are 1 best solutions below

3
beyowulf On

Think you need to use background-padding You can see documentation here

For example, using the video as a guide, I can make a button styled like this: enter image description here

But then if I set background-padding: 50px; It will appear like this: enter image description here

If you are using negative values, you should keep in mind that the button will not grow larger than the frame set in your storyboard or .xib.

The CSS I used was:

.btn-green {
    color :#446620;
    background-color:linear-gradient(#87c44a,#b4da77);
    border-width: 2px;
    border-color:#000000;
    border-style: solid;
    border-radius:10px;
    font-size: 13px;
    background-padding: 50px;
}