在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):cemolcay/MaterialCardView开源软件地址(OpenSource Url):https://github.com/cemolcay/MaterialCardView开源编程语言(OpenSource Language):Swift 91.0%开源软件介绍(OpenSource Introduction):MaterialCardViewCreate material design cards quick and easy DemoInstallationManuelCopy & paste CocoaPodsAdd to your pod 'MaterialCardView', '~> 0.0.2' UsageCreate a let c = MaterialCardView (
x: 10,
y: StatusBarHeight + 10,
w: ScreenWidth-20)
view.addSubview (c) And start to add
func addHeader (title: String)
func addHeader (view: UIView)
addCell (text: String, action: (()->Void)? = nil)
addCell (view: UIView, action: (()->Void)? = nil)
addCell (cell: MaterialCardCell)
func addFooter (title: String)
func addFooter (view: UIView)
MaterialCardAppearance var headerBackgroundColor: UIColor
var cellBackgroundColor: UIColor
var borderColor: UIColor
var titleFont: UIFont
var titleColor: UIColor
var textFont: UIFont
var textColor: UIColor
var shadowColor: UIColor
var rippleColor: UIColor
var rippleDuration: NSTimeInterval You can change The default appearance is func defaultAppearance () -> MaterialCardAppearance {
return MaterialCardAppearance (
headerBackgroundColor: UIColor.CardHeaderColor(),
cellBackgroundColor: UIColor.CardCellColor(),
borderColor: UIColor.CardBorderColor(),
titleFont: UIFont.TitleFont(),
titleColor: UIColor.TitleColor(),
textFont: UIFont.TextFont(),
textColor: UIColor.TextColor(),
shadowColor: UIColor.ShadowColor(),
rippleColor: UIColor.RippleColor(),
rippleDuration: rippleDuration)
} Which are MaterialAnimationTimingFunction enum MaterialAnimationTimingFunction {
case SwiftEnterInOut
case SwiftExitInOut
func timingFunction () -> CAMediaTimingFunction {
switch self {
case .SwiftEnterInOut:
return CAMediaTimingFunction (controlPoints: 0.4027, 0, 0.1, 1)
case .SwiftExitInOut:
return CAMediaTimingFunction (controlPoints: 0.4027, 0, 0.2256, 1)
}
}
}
SwiftEnterInOut
SwiftExitInOut
MaterialRippleLocation
RippleLayerAdds ripple animation when you add cells with action c.addCell("Item 1") { sender in
println("item 1 tapped")
} Add ripple to material card c.addRipple { () -> Void in
println("all card ripples")
} |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论