随笔分类 -  iphone开发

摘要:textField.font = [UIFont fontWithName:<#(NSString *)fontName#> size:<#(CGFloat)fontSize#>];终于找到了,全了。 阅读全文
posted @ 2011-10-12 15:26 松花江以南 阅读(1360) 评论(0) 推荐(0) 编辑
摘要:UITextFiled类,有代理方法。UITextFieldDeleda1. 怎样设置一个文本框[textField]使其不能编辑,就是点击的时候不让虚拟键盘弹出来。1.代理方法中的一个方法:-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField;- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{ NSLog(@"textFieldShouldBeginEditing"); //测试用 return NO; //这样设置后就成了。这样的话, 阅读全文
posted @ 2011-10-12 15:01 松花江以南 阅读(2258) 评论(0) 推荐(1) 编辑
摘要:代码如下://选择按钮 NSArray *buttonNames = [NSArray arrayWithObjects:@"今天", @"本周", @"本月", nil]; UISegmentedControl* segmentedControl = [[UISegmentedControl alloc] initWithItems:buttonNames]; [segmentedControl setFrame:CGRectMake(60, 10, 200, 40)]; segmentedControl.selectedSegme 阅读全文
posted @ 2011-10-12 09:08 松花江以南 阅读(2851) 评论(0) 推荐(0) 编辑
摘要:经常会遇到以下情况,textField被虚拟键盘挡住的情况,解决。RootViewController.h 中:#import <UIKit/UIKit.h>@interface RootViewController : UIViewController<UITextFieldDelegate> { UITextField *textField1; UITextField *textField2; }@property (nonatomic,retain) UITextField *textField1;@property (nonatomic ,retain) UIT 阅读全文
posted @ 2011-10-11 17:49 松花江以南 阅读(15383) 评论(0) 推荐(2) 编辑
摘要:UITextField编辑框经常会遇到关闭虚拟键盘的情况。总结一下,一下的方法。方法一:通过触摸背景关闭虚拟键盘在RootViewController.h中,如下:@interface RootViewController : UIViewController<UITextFieldDelegate> { UITextField *nameTextField; UITextField *numberTextField;}@property (nonatomic ,retain) UITextField *nameTextField;@property (nonatomic,reta 阅读全文
posted @ 2011-10-11 15:55 松花江以南 阅读(4232) 评论(0) 推荐(0) 编辑