0
Q
iOS按钮设计
A
回答
1
1
创建一个名为design.swift
然后将这些新文件:
import Foundation
import UIKit
@IBDesignable class CustomTextView : UITextView
{
@IBInspectable var cornerRadius: CGFloat {
get {
return layer.cornerRadius
}
set {
layer.cornerRadius = newValue
layer.masksToBounds = newValue > 0
}
}
@IBInspectable var borderWidth: CGFloat{
set {
layer.borderWidth = newValue
}
get{
return self.layer.borderWidth
}
}
@IBInspectable var borderColor: UIColor? {
set {
layer.borderColor = newValue?.CGColor
}
get{
let c = UIColor(CGColor: layer.borderColor!)
return c
}
}
}
@IBDesignable class CustomView : UIView{
@IBInspectable var cornerRadius: CGFloat {
get {
return layer.cornerRadius
}
set {
layer.cornerRadius = newValue
layer.masksToBounds = newValue > 0
}
}
@IBInspectable var borderWidth: CGFloat{
set {
layer.borderWidth = newValue
}
get{
return self.layer.borderWidth
}
}
@IBInspectable var borderColor: UIColor? {
set {
layer.borderColor = newValue?.CGColor
}
get{
let c = UIColor(CGColor: layer.borderColor!)
return c
}
}
}
@IBDesignable class CustomButton : UIButton{
@IBInspectable var cornerRadius: CGFloat {
get {
return layer.cornerRadius
}
set {
layer.cornerRadius = newValue
layer.masksToBounds = newValue > 0
}
}
@IBInspectable var borderWidth: CGFloat{
set {
layer.borderWidth = newValue
}
get{
return self.layer.borderWidth
}
}
@IBInspectable var borderColor: UIColor? {
set {
layer.borderColor = newValue?.CGColor
}
get{
let c = UIColor(CGColor: layer.borderColor!)
return c
}
}
}
然后点击您的按钮去上课的权利自定义
相关问题
- 1. 设计iOS按钮可扩展
- 2. 设计按钮
- 3. 设计按钮
- 4. wxPython,按钮设计
- 5. GWT设计一个按钮
- 6. 如何设计按钮
- 7. 如何设计IBAction按钮
- 8. 使用css设计按钮
- 9. 更改按钮的设计
- 10. 按钮设计问题
- 11. 设计XML按钮Android
- 12. 编辑按钮设计
- 13. 使用HTML设计按钮
- 14. mdpi的Android设计按钮
- 15. Sass ::单选按钮设计
- 16. HTML材质设计按钮
- 17. GWT:设置按钮/设计按钮的最佳方法?
- 18. 更改按钮设计,同时按它
- 19. iOS的设计性按钮的背景颜色不工作
- 20. 设计iOS应用程序和自定义按钮
- 21. iOS标准按钮? UIButton与UIBarButtonItem对比我自己的设计?
- 22. Android editTexts和材料设计中的IOS等按钮
- 23. iOS倒计时显示隐藏按钮
- 24. ios deleteconformation按钮
- 25. iOS图像按钮按下按钮
- 26. 我如何设计一个cero按钮。摆脱按钮主题?
- 27. 从UITableViewCell按钮设置计时器
- 28. 如何设计我的android 2.3按钮?
- 29. 我如何设计Gmail按钮发送
- 30. Netbeans无法显示设计按钮
我更新了我的问题。这是我到目前为止的尝试,但它不适合很好的设计元素... –
使用标准UIButton有什么问题? – rmaddy
我想让我的按钮脱颖而出 –