[英]Padding not working on UIButton with Pixate Freestyle
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. 我对Xcode中的Pixate Freestyle完全陌生,并且尝试使用它时,无法在UIButton上使用任何填充。 Other properties like background-color, border and border-radius are working but the padding doesn't seem to do anything. 其他属性(例如background-color,border和border-radius)都可以使用,但是填充似乎没有任何作用。
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. 我正在使用Xcode 7.0.1和最新版本的PixateFreestyle。
Thanks! 谢谢! :) :)
Think you need to use background-padding
You can see documentation here 认为您需要使用background-padding
您可以在此处查看文档
For example, using the video as a guide, I can make a button styled like this: 例如,以视频为指导,我可以制作一个样式如下的按钮:
But then if I set background-padding: 50px;
但是如果我设置background-padding: 50px;
It will appear like this: 它看起来像这样:
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. 如果使用负值,则应记住该按钮的大小不会超过情节提要或.xib中设置的框架。
The CSS I used was: 我使用的CSS是:
.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;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.