diff --git a/SwiftNotice.swift b/SwiftNotice.swift index 3285982..375ca98 100644 --- a/SwiftNotice.swift +++ b/SwiftNotice.swift @@ -108,7 +108,7 @@ class SwiftNotice: NSObject { let view = UIView() view.backgroundColor = UIColor(red: 0x6a/0x100, green: 0xb4/0x100, blue: 0x9f/0x100, alpha: 1) - let label = UILabel(frame: frame) + let label = UILabel(frame: frame.height > 20 ? CGRect(x: frame.origin.x, y: frame.origin.y + frame.height - 17, width: frame.width, height: 20) : frame) label.textAlignment = NSTextAlignment.center label.font = UIFont.systemFont(ofSize: 12) label.textColor = UIColor.white diff --git a/SwiftNoticeExample/SwiftNoticeExample.xcodeproj/project.xcworkspace/xcuserdata/JohnLui.xcuserdatad/UserInterfaceState.xcuserstate b/SwiftNoticeExample/SwiftNoticeExample.xcodeproj/project.xcworkspace/xcuserdata/JohnLui.xcuserdatad/UserInterfaceState.xcuserstate index 89c4654..62ad80c 100644 Binary files a/SwiftNoticeExample/SwiftNoticeExample.xcodeproj/project.xcworkspace/xcuserdata/JohnLui.xcuserdatad/UserInterfaceState.xcuserstate and b/SwiftNoticeExample/SwiftNoticeExample.xcodeproj/project.xcworkspace/xcuserdata/JohnLui.xcuserdatad/UserInterfaceState.xcuserstate differ