sf-symbols

Use SF Symbols system image for static UIApplicationShortcutItem

早过忘川 提交于 2020-08-02 06:14:26
问题 When specifying home screen quick actions, UIApplicationShortcutItems , in your Info.plist, is there a way to use a system image from SF Symbols? The docs noting the available iOS keys doesn't specify a key to do this, besides specifying one of the predefined enum cases from UIApplicationShortcutItemIconType such as UIApplicationShortcutIconTypeSearch . It is possible to use a system image when creating dynamic quick actions via a new initializer UIApplicationShortcutIcon.init(systemImageName

Inverted mask swiftui with system image

倾然丶 夕夏残阳落幕 提交于 2020-06-13 07:04:05
问题 I am trying to cut out a sf symbol from a circle shape in swiftUI. I currently have the following code: Circle() .fill(Color.white) .frame(width: 50, height: 50) .mask( Image(systemName: "play.fill") .font(.system(size: 24)) .foregroundColor(Color.black) .frame(width: 50, height: 50) ) Which generates: However, what I want is to invert the effect of the mask: The symbol is cut out of the circle as in the image below: Note that the actual background is not red as in the image but will be a

Find all available images for Image(systemName:) in SwiftUI

送分小仙女□ 提交于 2020-04-07 12:43:20
问题 Where can I find all the system images that are available in the initializer Image(systemName:) ? I've only been using "chevron" and "star.fill" so far, as discovered in Apple's SwiftUI tutorial series. However, I haven't been able to find a full list of icons in any official documentation. 回答1: These icons are called SF Symbols. There are over 1,500 symbols that can be used in apps running in iOS 13 and later. To browse the full set of symbols, download the SF Symbols app. For more info

HStack with SF Symbols Image not aligned centered

…衆ロ難τιáo~ 提交于 2020-03-17 12:03:51
问题 I have this simple SwiftUI code. I want all symbols to be aligned centered, just like the cloud symbol. struct ContentView : View { var body: some View { HStack(alignment: .center, spacing: 10.0) { Image(systemName: "cloud.sun") Image(systemName: "cloud") Image(systemName: "cloud.bolt") Text("Text") }.font(.title) } } But as you can see below, the first and the last symbol are not centered. Am I missing something, or is this a bug? Cheers! 回答1: This is what it's going on. The Image views are

HStack with SF Symbols Image not aligned centered

穿精又带淫゛_ 提交于 2020-03-17 12:03:43
问题 I have this simple SwiftUI code. I want all symbols to be aligned centered, just like the cloud symbol. struct ContentView : View { var body: some View { HStack(alignment: .center, spacing: 10.0) { Image(systemName: "cloud.sun") Image(systemName: "cloud") Image(systemName: "cloud.bolt") Text("Text") }.font(.title) } } But as you can see below, the first and the last symbol are not centered. Am I missing something, or is this a bug? Cheers! 回答1: This is what it's going on. The Image views are

How do i set a weight to SF Symbols for iOS 13?

流过昼夜 提交于 2019-12-19 05:06:52
问题 I have this Image(systemName: "arrow.right") But how do i make it bold, semibold etc? I am using the new SwiftUI. 回答1: When using the font modifier, set a weight to the font you're passing Image(systemName: "arrow.right") .font(Font.title.weight(.ultraLight)) 回答2: For UIKit, symbols can be configured as follows: UIImage(systemName: "arrow.right", withConfiguration: UIImage.SymbolConfiguration(pointSize: 16, weight: .bold)) 回答3: SwiftUI 1.0 I just wanted to also mention how to change the

How to use SF Symbols in iOS 12 and below?

回眸只為那壹抹淺笑 提交于 2019-12-18 18:39:42
问题 I am updating the icons in my app. After I heard Apple released an icon font named SF Symbols with iOS 13, I was wondering if I can only use them in iOS 13 or if it is possible to use them in lower versions of iOS too. If I want to use them, do I have to implement a fallback for older versions? 回答1: You can not use SFSymbols natively in iOS versions older than iOS 13. However if you are interested in using the graphics you can use the SFSymbols app to export SVG versions of the icon. Then use

How to use SF Symbols in iOS 12 and below?

大兔子大兔子 提交于 2019-12-18 18:39:26
问题 I am updating the icons in my app. After I heard Apple released an icon font named SF Symbols with iOS 13, I was wondering if I can only use them in iOS 13 or if it is possible to use them in lower versions of iOS too. If I want to use them, do I have to implement a fallback for older versions? 回答1: You can not use SFSymbols natively in iOS versions older than iOS 13. However if you are interested in using the graphics you can use the SFSymbols app to export SVG versions of the icon. Then use

How do i set a weight to SF Symbols for iOS 13?

和自甴很熟 提交于 2019-12-01 16:27:42
I have this Image(systemName: "arrow.right") But how do i make it bold, semibold etc? I am using the new SwiftUI. When using the font modifier, set a weight to the font you're passing Image(systemName: "arrow.right") .font(Font.title.weight(.ultraLight)) For UIKit, symbols can be configured as follows: UIImage(systemName: "arrow.right", withConfiguration: UIImage.SymbolConfiguration(pointSize: 16, weight: .bold)) SwiftUI 1.0 I just wanted to also mention how to change the weight along with a custom font size. HStack(spacing: 40) { Image(systemName: "moon.zzz") .font(Font.system(size: 60,

How to use SF Symbols in iOS 12 and below?

久未见 提交于 2019-12-01 03:02:48
I am updating the icons in my app. After I heard Apple released an icon font named SF Symbols with iOS 13, I was wondering if I can only use them in iOS 13 or if it is possible to use them in lower versions of iOS too. If I want to use them, do I have to implement a fallback for older versions? funkenstrahlen You can not use SFSymbols natively in iOS versions older than iOS 13. However if you are interested in using the graphics you can use the SFSymbols app to export SVG versions of the icon. Then use some graphics tool to convert them to icons you can import into your asset catalog.