gpt4 book ai didi

ios - WKInterfaceButton 在 WatchKit 中的隐藏状态

转载 作者:搜寻专家 更新时间:2023-10-31 22:48:43 26 4
gpt4 key购买 nike

有没有办法查看WatchKit中WKInterfaceButton的当前隐藏状态?

最佳答案

看来你不能那样做。但是您可以使用状态存储自己的变量并使用它。

您可以在下面查看按钮父类的定义。

public class WKInterfaceObject : NSObject {

public func setHidden(hidden: Bool)
public func setAlpha(alpha: CGFloat)

@available(watchOS 2.0, *)
public func setHorizontalAlignment(horizontalAlignment: WKInterfaceObjectHorizontalAlignment)
@available(watchOS 2.0, *)
public func setVerticalAlignment(verticalAlignment: WKInterfaceObjectVerticalAlignment)

public func setWidth(width: CGFloat)
public func setHeight(height: CGFloat)
@available(watchOS 2.0, *)
public func setRelativeWidth(width: CGFloat, withAdjustment adjustment: CGFloat)
@available(watchOS 2.0, *)
public func setRelativeHeight(height: CGFloat, withAdjustment adjustment: CGFloat)

@available(watchOS 2.0, *)
public func sizeToFitWidth()
@available(watchOS 2.0, *)
public func sizeToFitHeight()

public var interfaceProperty: String { get } // same as controller's property name
}

关于ios - WKInterfaceButton 在 WatchKit 中的隐藏状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32915249/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com