
UI控件基本用法
文章平均质量分 64
starnuoyan
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
iOS让键盘消失的技巧
转载自:http://blog.youkuaiyun.com/favormm/article/details/7492692焦点在UITextField或UITextView中的时候,键盘会出现,想点一下背景就让键盘消失。这是在手持设备上服合用户的操作习惯。当然方法有很多,在这儿我说一个比较实用的方法。因为UIView默认是不能关联方法调用的,而UIControl则不一样,它可以关联很多方法。转载 2012-04-24 23:02:51 · 339 阅读 · 0 评论 -
自定义UINavigationBar背景图片和颜色
转载:http://hi.baidu.com/superssuber/blog/item/cca912197cee552734fa4111.html首先准备导航栏背景图片,大小 320x44, @2x文件大小640x88,iOS5以后更改背景图片较简单UINavigationBar *navBar = self.navigationController.navigationBar;转载 2012-07-20 18:17:38 · 372 阅读 · 0 评论 -
为UIView及其子类添加圆角边框
//设置圆角边框someView.layer.cornerRadius = 8;someView.layer.masksToBounds = YES;//设置边框及边框颜色someView.layer.borderWidth = 8;someView.layer.borderColor =[ [UIColor grayColor] CGColor];转载 2012-06-06 16:51:03 · 278 阅读 · 0 评论 -
UIView 基本用法
要屏幕Uiview 的点击事件 可以设置view.userInteractionEnabled =NO;原创 2012-04-23 11:16:51 · 310 阅读 · 0 评论 -
UIview基本用法
要屏幕Uiview 的点击事件 可以设置view.userInteractionEnabled = NO;原创 2012-04-23 11:23:30 · 375 阅读 · 0 评论 -
使用UIImagePickerController
if ([UIImagePickerControllerisSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *imagepick = [[UIImagePickerControlleralloc] init];转载 2012-05-07 10:35:56 · 512 阅读 · 0 评论 -
UIAlertView 的基本使用方法
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Error" message:@"I'm sorry Dave, I'm afraid I can't do that." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease];转载 2012-04-19 21:58:10 · 370 阅读 · 0 评论 -
UIScrollView使用方法
初始化代码方法为:mainView = [[UIScrollView alloc] initWithFrame:CGRectMake(0.0, 0.0, self.view.frame.size.width, 400)];//初始化scrollview方法mainView.directionalLockEnabled = YES;//锁定滑动的方向mainView.转载 2012-04-19 21:59:49 · 343 阅读 · 0 评论 -
UItextField UITextView 有关键盘的设置
禁用UITextField的copy,paste,copy的menu只需覆盖canPerformAction:withSender方法就可以,canPerformAction:withSender属于UIResponder类的。如下:-(BOOL)canPerformAction:(SEL)action withSender:(id)sender {UIMenuCont转载 2012-04-18 23:52:01 · 509 阅读 · 0 评论 -
UITextField常用控件
查看函数的方法:按住command键双击进入函数声明按住alt键双击进入doc文档///////////////////////////////////////////////////////////////文本框常用方法:如何用程序删除文本框中选中的文本[textView delete: nil];///////////////////////////转载 2012-04-18 22:40:56 · 432 阅读 · 0 评论 -
多个UIAlertView的使用
在同一个ViewController里面,当我们需要同时用到多个UIAlertView来提示不同的信息时。可以直接定义。 UIAlertView *view = [[[UIAlertView alloc] initWithTitle: @"Choose Configuration:" message: @"" delegate: self cancelButtonTitle: @"Produc转载 2012-04-19 21:59:05 · 379 阅读 · 0 评论 -
UILable常用的方法
1。//初始化定义UILabel*level_label =[[UILabelalloc]initWithFrame:CGRectMake(20,100,50,100)];2。//设置字体UIFont* uifont =[UIFontsystemFontOfSize:17.0];[level_labelsetFont:uifont];转载 2012-04-18 22:34:32 · 330 阅读 · 0 评论 -
UIButton常用方法
1. //初始化定义btn的类型UIButton *btnIn = [UIButton buttonWithType:UIButtonTypeRoundedRect];2.//定义位置btnIn.frame = CGRectMake(30, 360, 90, 35);3.定义文字,forState:Normal代表标准情况下, Highighted代表按下去 [btnIn转载 2012-04-18 22:33:41 · 557 阅读 · 0 评论 -
UITableView 基本使用方法
UITableView 基本使用方法 1. 首先,Controller需要实现两个 delegate ,分别是 UITableViewDelegate 和 UITableViewDataSource 2.然后 UITableView对象的 delegate要设置为 self。 3. 然后就可以实现这些delegate的一些方法拉。转载 2012-04-18 22:38:16 · 308 阅读 · 0 评论 -
iphone 与 js 交互
/*定义webview 初始化*/然后把js打包放入项目中XXXX.bundle /*webView加载JS*/ NSBundle *bundle = [NSBundlebundleWithPath:[[NSBundlemainBundle] pathForResource:@"XXXX"ofType:@"bundle"]]; NSURL原创 2012-04-26 09:55:19 · 533 阅读 · 0 评论 -
实现自适应高度的 UITableViewCell 或 UILabel
转载 :http://www.cnblogs.com/viviyachu/archive/2012/03/07/2383363.html在使用UILabel存放字符串时,经常需要获取label的长宽数据,本文列出了部分常用的计算方法。1.获取宽度,获取字符串不折行单行显示时所需要的长度CGSize titleSize = [aString sizeWithFont:font转载 2012-09-27 01:53:13 · 653 阅读 · 0 评论