草庐IT

ibinspectable

全部标签

ios - 如何将渐变应用于 iOS Swift 应用程序的背景 View

我正在尝试将渐变应用为View(Storyboard的主视图)的背景色。代码运行,但没有任何变化。我正在使用xCodeBeta2和Swift。代码如下:classColors{letcolorTop=UIColor(red:192.0/255.0,green:38.0/255.0,blue:42.0/255.0,alpha:1.0)letcolorBottom=UIColor(red:35.0/255.0,green:2.0/255.0,blue:2.0/255.0,alpha:1.0)letgl:CAGradientLayerinit(){gl=CAGradientLayer()gl

ios - 如何将渐变应用于 iOS Swift 应用程序的背景 View

我正在尝试将渐变应用为View(Storyboard的主视图)的背景色。代码运行,但没有任何变化。我正在使用xCodeBeta2和Swift。代码如下:classColors{letcolorTop=UIColor(red:192.0/255.0,green:38.0/255.0,blue:42.0/255.0,alpha:1.0)letcolorBottom=UIColor(red:35.0/255.0,green:2.0/255.0,blue:2.0/255.0,alpha:1.0)letgl:CAGradientLayerinit(){gl=CAGradientLayer()gl

是@ibinspectable var确实设置了一个阶段的值

这是我的代码@IBDesignableclassBarPopView:UIView{@IBInspectablevarft:NSString="1"@IBInspectablevarffPrompt:NSString="Area"overrideinit(frame:CGRect){super.init(frame:frame)setupView()}requiredinit?(coderaDecoder:NSCoder){super.init(coder:aDecoder)setupView()}funcsetupView(){print("text:\(ft),prompt:\(ffPro

ios - @IBInspectable : wrong bounds and frames at runtime when I add subviews

这是我的@IBInspectable:代码:@IBDesignableclassPBOView:UIView{@IBInspectablevarborderRightColor:UIColor?{didSet{letborderRightView=UIView(frame:CGRectMake(frame.size.width-10,0,10,frame.size.height))borderRightView.backgroundColor=borderRightColoraddSubview(borderRightView)}}}这是Storyboard中的结果:UIView的宽度

ios - IBInspectable UIView 属性

我可以让我的UIView@property可检查吗?@interfaceSuperview:UIView@property(nonatomic,weak,readonly)IBInspectableUIButton*stopButton;@property(nonatomic,weak,readonly)IBInspectablePKCircleProgressView*circleProgressView;@end我已经创建了一个可设计的ViewPKCircleProgressView,我希望它可以从IB进行编辑。我还创建了另一个可设计的View,其中包含PKCircleProgre

iOS,带有调整类和 IBInspectables 的界面生成器错误?

我不确定发生了什么,我正在努力解决这个问题,我正在尝试在代码中满足不同的大小调整类,以适应使用IBInspectables的一些特殊情况。在模拟器上,以下代码在iPad、iPhone4和iPhone6+上按预期工作。但是在界面生成器中,仅预览任何/任何和常规/常规工作。这似乎是一个错误?或者有人对可能有效的替代方法有任何建议吗?-(void)drawRect:(CGRect)rect{//DrawingcodeCGFloatl_borderWidth=self.AaBorderWidth;//8.5CGFloatl_cornerRadius=self.AaCornerRad;//33C

ios - IBInspectable 和协议(protocol)

我正在使用名为“LiveRendering”的新Xcode6功能。因为我需要在不同的自定义View上大量使用一些可检查的属性,所以我想在协议(protocol)中声明它们。例如:LiveRenderingTextAttributesProtocol(声明textColor、textSize的可检查属性LiveRenderingBorderAttributesProtocol(声明borderStyle、borderColor、borderWidth的可检查属性)等...之后,每个自定义View实现它需要的协议(protocol)。但是我在InterfaceBuilder“属性检查器”列

ios - 是否可以删除父类(super class)的 IBInspectable 属性?

我正在编写一个继承自另一个的自定义View(想想继承自UIButton的CustomButton)。父类(superclass)(UIButton)有一些可以使用InterfaceBuilder的检查器检查的属性(例如字体、颜色等)。我希望我的自定义类仅显示我自己的可检查属性,并抽象出无论如何都会被我的类覆盖的较低级别的选项(来自UIButton)。是否可以从父类(superclass)中删除IBInspectable属性? 最佳答案 听起来好像您想扩展UIView类并从InterfaceBuilder中删除背景属性。这在结构上是不

ios - Xamarin 中的 IBInspectable

有谁知道如何在Xamarin中使用IBInspectable或者是否可能?我在该主题上唯一发现的是this这没什么希望。在API文档中也找不到任何相关内容 最佳答案 有类似的东西(自定义控件)。它的工作原理与IBInspectable或IBDesignable相同。查看此官方链接:https://developer.xamarin.com/guides/ios/user_interface/designer/ios_designable_controls_walkthrough/ 关于i

macos - IBInspectable 不呈现 NSView 层

我想编辑NSView的边框宽度和背景颜色,并使这些值成为IBInspectable:@IBInspectablevarborderWidth:CGFloat{set{layer?.borderWidth=newValue}get{returnlayer!.borderWidth}}@IBInspectablevarbackgroundColor:NSColor{set{layer?.backgroundColor=newValue.CGColor}get{returnNSColor(CGColor:layer!.backgroundColor)!}}在init方法中,我这样写:over