英文:
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)
}
}
英文:
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)
}
}
答案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 ? "rectangle.inset.filled" : "rectangle")
.resizable()
.fontWeight(.light) // <--
or even
Image(systemName: isSelected ? "rectangle.inset.filled" : "rectangle")
.resizable()
.fontWeight(.ultraLight) // <--
thin enough?
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论