[英]UIButton - rounded corners in highlight state
在下面的圖像中,按鈕被按下。 陰影是方形的。 如何使陰影具有圓角邊緣?
這是我的操作方式:
1)子類化UIButton
2)像這樣更改圖層:
public class GalleryButton: UIButton
{
public GalleryButton (RectangleF frame) : base(frame)
{
this.Layer.CornerRadius = 12f;
this.Layer.MasksToBounds = true;
this.Layer.BorderWidth = 0f;
}
我認為,如果您有透明的png,它會按原樣工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.