Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何复制UIKit/SwiftUI元素背景(如UITabBar/TabView背景)_Swift_Uikit_Swiftui_Uinavigationbar_Uitabbar - Fatal编程技术网

如何复制UIKit/SwiftUI元素背景(如UITabBar/TabView背景)

如何复制UIKit/SwiftUI元素背景(如UITabBar/TabView背景),swift,uikit,swiftui,uinavigationbar,uitabbar,Swift,Uikit,Swiftui,Uinavigationbar,Uitabbar,我想复制uitabar(和类似的UIKit/SwiftUI元素)的背景(包括相同的模糊效果和薄灰色边框及其自适应性),并将其应用到另一个UI元素。 我怎样才能做到这一点 我试图复制它,但当我将新视图堆叠到其他不同颜色的视图上时,行为会有所不同(并且不支持夜间模式) 我不在乎答案是针对UIKit还是SwiftUI框架。请参见UIInterface模块中的UIColor扩展,如以下示例(其中有许多): 边界有这样的解决方案,否则我将不得不手动创建?@LorenzoFiamingo,我不想复制粘贴整个

我想复制uitabar(和类似的UIKit/SwiftUI元素)的背景(包括相同的模糊效果和薄灰色边框及其自适应性),并将其应用到另一个UI元素。 我怎样才能做到这一点

我试图复制它,但当我将新视图堆叠到其他不同颜色的视图上时,行为会有所不同(并且不支持夜间模式)


我不在乎答案是针对UIKit还是SwiftUI框架。

请参见
UIInterface
模块中的
UIColor
扩展,如以下示例(其中有许多):


边界有这样的解决方案,否则我将不得不手动创建?@LorenzoFiamingo,我不想复制粘贴整个UIInterface模块,答案是:)
UIColor.separator
UIColor.opaqueSeparator
。。。通读UIInterface,这里有很好的描述。
 * 1. systemBackground
 *    Use this stack for views with standard table views, and designs which have a white
 *    primary background in light mode.
 */
@available(iOS 13.0, *)
open class var systemBackground: UIColor { get }


/* 2. systemGroupedBackground
 *    Use this stack for views with grouped content, such as grouped tables and
 *    platter-based designs. These are like grouped table views, but you may use these
 *    colors in places where a table view wouldn't make sense.
 */
@available(iOS 13.0, *)
open class var systemGroupedBackground: UIColor { get }


/* Fill colors for UI elements.
 * These are meant to be used over the background colors, since their alpha component is less than 1.
 *
 * systemFillColor is appropriate for filling thin and small shapes.
 * Example: The track of a slider.
 */
@available(iOS 13.0, *)
open class var systemFill: UIColor { get }