减小SF符号的边框宽度。

huangapple go评论69阅读模式
英文:

Decrease border width of SF Symbol

问题

减小图像的边框宽度,它的SF符号,我尝试了不同的方法,但没有成功

struct CheckboxView: View {
    var isSelected: Bool
    var size: CGSize = CGSize(width: 30, height: 30)
    var body: some View {
        Image(systemName: isSelected ? "rectangle.inset.filled" : "rectangle")
            .resizable()
            .frame(width: size.width, height: size.height)
    }
}

struct CheckboxView_Previews: PreviewProvider {
    static var previews: some View {
        CheckboxView(isSelected: false)
    }
}

当前 减小SF符号的边框宽度。

变成这样
减小SF符号的边框宽度。

英文:

Decrease border width of the image, Its SF Symbol, I tried different ways but its not working

struct CheckboxView: View {
    var isSelected: Bool
    var size: CGSize = CGSize(width: 30, height: 30)
    var body: some View {
        Image(systemName: isSelected ? "rectangle.inset.filled" : "rectangle")
            .resizable()
            .frame(width: size.width, height: size.height)
    }
}

struct CheckboxView_Previews: PreviewProvider {
    static var previews: some View {
        CheckboxView(isSelected: false)
    }
}

Currently 减小SF符号的边框宽度。

To this
减小SF符号的边框宽度。

答案1

得分: 0

图像

Image(systemName: isSelected ? "rectangle.inset.filled" : "rectangle")
    .resizable()
    .fontWeight(.light) // <--

或者甚至

Image(systemName: isSelected ? "rectangle.inset.filled" : "rectangle")
    .resizable()
    .fontWeight(.ultraLight) // <--

足够薄吗?
英文:

Is

Image(systemName: isSelected ? &quot;rectangle.inset.filled&quot; : &quot;rectangle&quot;)
    .resizable()
    .fontWeight(.light) // &lt;--

or even

Image(systemName: isSelected ? &quot;rectangle.inset.filled&quot; : &quot;rectangle&quot;)
    .resizable()
    .fontWeight(.ultraLight) // &lt;--

thin enough?

huangapple
  • 本文由 发表于 2023年6月27日 21:29:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/76565390.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定