Swift开发教程--设置圆角Button和圆角边框TextView

设置圆角Button

button.layer.borderColor =
UIColor.whiteColor().CGColor;

button.layer.borderWidth =
2;

button.layer.cornerRadius =
16;

设置圆角边框TextView

inputTextView.layer.borderColor =
UIColor(red: 60/255, green: 40/255, blue: 129/255, alpha: 1).CGColor;

inputTextView.layer.borderWidth = 1;

inputTextView.layer.cornerRadius = 16;

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-07-30 20:19:20

Swift开发教程--设置圆角Button和圆角边框TextView的相关文章

Swift开发教程--如何给UITextView添加圆角边框

直接上代码: self.textView.layer.borderColor = UIColor(red: 60/255, green: 40/255, blue: 129/255, alpha: 1).CGColor; self.textView.layer.borderWidth = 2; self.textView.layer.cornerRadius = 16; 版权声明:本文为博主原创文章,未经博主允许不得转载.

Swift开发教程--设置UIViewController的背景透明

非常easy的一句代码 self.view.backgroundColor = UIColor.clearColor() 由此联想开来,非常多的控件想设置为背景透明都能够用UIColor.clearColor()

Swift开发教程--实现UITableView报错does not conform to protocol 'UITableViewDataSource‘

通过实践,要是把下面三个协议方法都实现了就不会报错了.另外还需要注意!的问题. func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int{ } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{ } func tableView(ta

Swift开发教程

IOS开发视频教程非常全面,总共39G,系统的介绍了Swift这门苹果今年推出的开发语言.苏苏是也是一个IOS开发小菜,Swift比Objective-C更加容易让新手理解,如果希望能进入IOS这个高帅富程序员行列,下载它学习吧. 教程目录: 第1季 Swift基础语法 第2季 Swift高级语法 第3季 构建Swift UI 第4季 Swift微信 From:http://www.2cifang.com/thread-612-1-1.html 另外还可以参看: 苹果Swift编程语言入门教程[

Swift开发教程--怎样设置状态栏的文字颜色

第一步:在Info.plist中设置UIViewControllerBasedStatusBarAppearance 为NO 第二步:在viewDidLoad中加一句 UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent; 这样就能够把默认的黑色改为白色.

Swift开发教程--如何设置状态栏的文字颜色

第一步:在Info.plist中设置UIViewControllerBasedStatusBarAppearance 为NO 第二步:在viewDidLoad中加一句 UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent; 这样就可以把默认的黑色改为白色. 版权声明:本文为博主原创文章,未经博主允许不得转载.

swift开发教程--如何设置导航控制器标题栏的字体及颜色

self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName:UIColor.whiteColor(),UIFont(name: "Heiti SC", size: 24.0)!]; 版权声明:本文为博主原创文章,未经博主允许不得转载.

从0开始学习Swift开发IOS应用(5)——Button

新建一个button 视图:拖拽一个button到视图里即可 代码 var btn = UIButton(frame:CGRectMake(20,20,100,200))//初始化一个button的位置(x,y,width,height) self.view.addSubView(btn)//把他添加到视图中 button常用属性 Type :System ios7以前是圆角矩形 Title 标题 Font 字体 字号 Text Color 字体颜色 Shadow Color 背景色 Image

Swift开发教程--使用Storyboard进行界面跳转

使用storyboard结合代码来做确实可以给开发带来很多的便利. 在实践的过程中,我们经常会遇到界面的跳转问题.通过控件和界面的建立的"连接"就可以了. 如果是navigationcontroller的跳转,则选择push的方式(否则xcode运行的时候会报错): 如果是Viewcontroller的跳转,则选择modal的方式. 如果你想通过代码来打开另外一个界面,则需要设置他们之间连接的segue.identifier,比如你设置为jumpid. 然后代码就可以这么写: self