jjzjj

ASButtonNode

全部标签

ios - Texture ASButtonNode,如何在文字右边设置图片

这样可以自定义标题和图片的距离 最佳答案 你可以使用ASOverlayLayoutSpec。像这样。------------ASOverlayLayoutSpec------------|-ASInsetLayoutSpecASInsetLayoutSpec|||ASButtonNode||ASImageNode|||-----------------------------------|-------------------------------------------引用http://texturegroup.org/docs

asyncdisplaykit asbuttonnode如何设置buttonType

我想获得一个与Uibutton(类型:.System)一样的纽扣节点。如何设置看答案letbuttonNode=ASDisplayNode{()->UIButtoninletbutton=UIButton(type:.system)button.backgroundColor=UIColor.whitebutton.cornerRadius=4button.setTitleColor(UIColor.red,for:.normal)button.titleLabel?.font=UIFont.systemFont(ofSize:17)returnbutton}ifletbutton=butto

纹理asbuttonnode,如何在文本右边设置图像

这样,可以定制标题和图像的距离看答案您可以使用ASOverlayLayoutSpec.像这样。------------ASOverlayLayoutSpec------------|-ASInsetLayoutSpecASInsetLayoutSpec|||ASButtonNode||ASImageNode|||-----------------------------------|-------------------------------------------参考http://texturegroup.org/docs/layout2-layoutspec-types.html#aso

ios - 如何为 ASDisplayNode 或 ASButtonNode 添加渐变

我想为ASDisplayNode/ASButtonNode添加渐变背景。我试过创建一个渐变层并将其添加为这样的子层-CAGradientLayer*gradient=[CAGradientLayerlayer];gradient.frame=button.frame;gradient.colors=@[[UIColorredColor],[UIColorblueColor]];[button.view.layerinsertSublayer:gradientatIndex:0];其中button是ASButtonNode类型,但这只是为按钮提供了白色背景。我也找不到很多文档来实现这一目