IOS UITextView
来源:互联网 发布:js中怎么给input赋值 编辑:程序博客网 时间:2024/05/23 13:08
//// ViewController.swift// UITextView//// Created by liaojianguo on 15/11/7.// Copyright © 2015年 liaojianguo. All rights reserved.//import UIKitclass ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. let textViewFrame = CGRectMake(10.0,100.0,240.0,90.0); let textView = UITextView(frame: textViewFrame) textView.layer.borderWidth=1 //layer为层的意思,border为包边,边界的意思 textView.layer.borderColor=UIColor.grayColor().CGColor textView.editable=true//是否可以编辑 //textView 和 UILabel一样,是继承与UIView textView.dataDetectorTypes=UIDataDetectorTypes.All//detector为检测器,检测是否有网页、电话等进行链接 textView.layer.cornerRadius = 6//圆角 textView.layer.masksToBounds = true textView.scrollEnabled=true//可以滚动 textView.keyboardType = UIKeyboardType.NumberPad//数字键盘 textView.layer.borderColor = UIColor(red: 60/255, green: 40/255, blue: 129/255, alpha: 1).CGColor; textView.autoresizingMask = UIViewAutoresizing.FlexibleHeight//自动适配高度 //下面为加图片背景,网上没有找到swift语言的该组建的加图片,我是根据object-c翻译过来的,测试成功了 let image = UIImage(named:"cat.jpg") let imageView = UIImageView(frame: textView.bounds) imageView.image = image textView.addSubview(imageView) textView.sendSubviewToBack(imageView) self.view.addSubview(textView) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. }}
0 0
- ios UITextView
- IOS UITextView
- iOS UITextView
- iOS UITextView
- ios学习--UItextview
- IOS UITextView详解
- IOS UITextView自适应高度
- iOS开发-UITextView
- iOS UITextView字数限制
- IOS UITextView自适应高度
- iOS:UITextView自适应高度
- ios UITextView 垂直居中
- IOS UITextView加上placeholder
- IOS开发-UItextView
- IOS UITextView自适应高度
- ios UITextView 提示文本
- iOS UITextView加上placeholder
- IOS UITextView加上placeholder
- MySql数据库 事务隔离级别
- HDU 1176 免费馅饼
- Android 正则表达式 Pattern 和 Matcher
- Spark入门之七:了解SparkSQL运行计划及调优
- 将单链表H逆置
- IOS UITextView
- 欢迎加入纯净战役服务器
- HDU 3549 最大流 水题
- Hive--HiveQL:查询
- UVa 442 Matrix Chain Multiplication(栈)
- vs2010调试小技巧
- Python编写微信打飞机小游戏(一)
- uva 1617——Laptop
- [Android]View响应屏幕触摸事件