IOS-txt文件UTF8、UTF16格式
摘要:在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions中添加如下测试:NSString* path = [[NSBundlemainBundle] pathForResource:@"textfile"ofType:@"txt"]; NSStringEncoding enc = NSUTF8StringEncoding; // this is a lie, so an error will r
阅读全文
posted @
2012-07-24 16:33
tx天翔
阅读(2248)
推荐(0)
IOS-Navigation的添加(RootViewController)
摘要:添加Nav方法:在AppDelegate中.h文件@property (strong, nonatomic) UINavigationController *navC;.m文件 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions添加方法2种如下:1 、self.navC = [[[UINavigationControlleralloc] init] autorelease]; [self.navCpushViewControll.
阅读全文
posted @
2012-07-23 10:58
tx天翔
阅读(2674)
推荐(0)
IOS-XMPP arc用方法-fobjc-arc
摘要:#if ! __has_feature(objc_arc)#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).#endif
阅读全文
posted @
2012-07-22 22:06
tx天翔
阅读(543)
推荐(0)
IOS-Colouring fun with moreNavigationController
摘要:http://runmad.com/blog/2010/01/coloring-fun-with-morenavigationcontroller-and-it/修改More页面的Navigation背景及Edit Button [self.tabBarVC.moreNavigationController.navigationBarsetBackgroundImage:[UIImageimageNamed:@"NavBack.png"] forBarMetrics:UIBarMetricsDefault];// self.tabBarVC.moreNavigationCo
阅读全文
posted @
2012-07-22 12:20
tx天翔
阅读(677)
推荐(0)
IOS-特别注意“self.label” 与“label_”的使用,统一并区别。
摘要:IOS-特别注意“self.label” 与“label_”的使用,统一并区别。
阅读全文
posted @
2012-07-07 17:02
tx天翔
阅读(343)
推荐(0)
IOS-iPad ImagePickerView 拍照中,点击“use”,dismiss popover
摘要:iPad ImagePickerView 拍照中,点击“use”的同时,dismiss popover即消失所在的框,不必再点击其他区域。UIImagePickerController的delegate如下:#pragma mark - UIImagePickerController delegate methods- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInf
阅读全文
posted @
2012-07-05 14:38
tx天翔
阅读(332)
推荐(0)
IOS-resign keyboard 新法儿
摘要:退键盘新法:在需要的方法中添加:[self.view endEditing:YES];即可见效。
阅读全文
posted @
2012-07-05 10:13
tx天翔
阅读(263)
推荐(0)
IOS-iPad Hide UIActionSheet button处理方法
摘要:iPad的UIActionSheet方法中没有cancel,点击popover其他区域即消失,但是,往往其他区域有Button,比如:UINavigationBarItem 的leftBarButton 或者rightBarButton,这时点击,就会出现程序崩掉。方法:(在点击的button方法中添加如下代码:)if ([self.actionSheet isVisible]) { [self.actionSheet dismissWithClickedButtonIndex:self.actionSheet.cancelButtonIndex animated:YES]; }此方法引用于:
阅读全文
posted @
2012-07-04 19:01
tx天翔
阅读(1058)
推荐(0)
IOS-中英文键盘判断方法学习
摘要:- (void)keyboardWillChangeFrame:(NSNotification *)notification{ // if(!isDisplayFaceBox){ #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { #endif #if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_2 NSValue *keyboardBoundsValue =
阅读全文
posted @
2012-07-04 12:56
tx天翔
阅读(4076)
推荐(0)
IOS-UITextField类
摘要:文字属性textplaceholder //默认使用70%灰色 font textColor textAlignment文字大小adjustsFontSizeToFitWidthminimumFontSize编辑行为editing //是否正在编辑(read-only)clearsOnBeginEditing展现形态borderStyle //默认UITextBorderStyleNone,是UITextBorderStyleRoundedRect时自定义的background无效backgrounddisabledBackgroundproperty //backgrou...
阅读全文
posted @
2012-07-03 11:28
tx天翔
阅读(2893)
推荐(0)
IOS-UITextField重写文字区域to left、center、right、up、down in TextField
摘要:重写UITextField方法:-(CGRect)textRectForBounds:(CGRect)bounds;效果如图:-------->-(CGRect)editingRectForBounds:(CGRect)bounds;@interfaceMYTextField:UITextField@end@implementationMYTextField-(CGRect)textRectForBounds:(CGRect)bounds { int margin =10; CGRect inset =CGRectMake(bounds.origin.x + margin, bounds
阅读全文
posted @
2012-07-03 09:31
tx天翔
阅读(1437)
推荐(0)