Keyboard 遮擋 UITextField

方法一:通過View的中心位置來移動-(BOOL)textFieldShouldReturn:(id)sender{ self.view.center=CGPointMake(160,207); [sender resignFirstResponder]; return YES;}- (BOOL)textFieldShouldBeginEditing:(id)sender{ UITextField *textField = (UITextField

iPhone控制項之UIImageView

- (void)viewDidLoad { [super viewDidLoad]; UIImage *anImage = [UIImage imageNamed:@"apple.png"]; UIImageView *myImageView = [[UIImageView alloc] initWithImage:anImage]; [[self view] addSubview:myImageView];//scale our height and width by

iPhone應用程式間傳遞資料iPhone應用程式間通訊

  前一篇簡單的介紹了iPhone應用程式間通訊,主要是通過在被調用應用的Info.plist中加入URL方案,在應用中通過openUrl來實現程式的調用。而應用程式間的資料傳遞則可以更具url來實現,例如我要在test應用中輸入一個參數,將其傳遞給URLSchemeDemo中。則可以按照下面方法實現: NSString *temp = [NSString stringWithFormat:@"URLSchemeDemoapp:message=%@",self.message.text];

Cocoa設計模式之委託

protocol-協議,就是使用了這個協議後就要按照這個協議來辦事,協議要求實現的方法就一定要實現。 delegate-委託,顧名思義就是委託別人辦事,就是當一件事情發生後,自己不處理,讓別人來處理。當一個A view 裡麵包含了B view,b view需要修改a view介面,那麼這個時候就需要用到委託了。需要幾個步驟1,首先定一個協議2,a view實現協議中的方法3,b view設定一個委託變數4,把b view的委託變數設定成a view,意思就是 ,b view委託a

iPhone控制項之UIScrollView

首先實現UIScrollViewDelegate協議:#import <UIKit/UIKit.h>@interface Activity01ViewController : UIViewController<UIScrollViewDelegate>{ UIScrollView *myscrollview;}@property (nonatomic,retain) UIScrollView *myscrollview;@end實現協議的下列方法:#import &

iPhone控制項之UIPickerView2

1 #import <UIKit/UIKit.h>2 3 @interface UITestViewController : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate>4 {5 6 }7 8 @end 1 // 2 // UITestViewController.m 3 // UITest 4 // 5 6 #import "UITestViewController.h"

iPhone控制項之UIPageControl

1 // 2 // UITestViewController.m 3 // UITest 4 // 5 6 #import "UITestViewController.h" 7 8 UIScrollView *myScrollView; 9 UIPageControl *myPageControl; 10 11 @implementation UITestViewController 12 13 -

郵件伺服器之SMTP協議分析

 第1章. SMTP概述 1.1. SMTP在郵件通訊過程中的位置SMTP,即簡單郵件傳送協議,所對應RFC文檔為RFC821。同http等多數應用程式層協議一樣,它工作在C/S模式下,用來實現網際網路上的郵件傳送。SMTP在整個電子郵件通訊中所處的位置1所示。                                              

NSString/NSData/char*類型轉換

參考來自:http://www.cnblogs.com/pengyingh/articles/2341880.html1. NSString轉化為UNICODE String:(NSString*)fname = @“Test”;char fnameStr[10];memcpy(fnameStr, [fname cStringUsingEncoding:NSUnicodeStringEncoding], 2*([fname

iPhone開發之MD5加密

引入標頭檔:#import <CommonCrypto/CommonDigest.h>密碼編譯演算法://TODO: md5 加密方法- (NSString*)md5Digest:(NSString *)str{ //32位MD5小寫 const char *cStr = [str UTF8String]; unsigned char result[32]; CC_MD5( cStr, strlen(cStr), result );

多線程之NSThread

一、線程的建立和啟動NSThread建立主要有兩種直接方式:[NSThread detachNewThreadSelector:@selector(myThreadMainMethod:) toTarget:self withObject:nil];和NSThread* myThread = [[NSThread alloc] initWithTarget:self

iPhone開發之自訂柱狀圖

//// Histogram.h// CGraph//// Created by Fox on 12-4-16.// Copyright 2012 __MyCompanyName__. All rights reserved.////繪製柱狀圖#import <UIKit/UIKit.h>#define kindex 4@interface Histogram : UIView {CGFloat colors[kindex][4];//每一個柱狀圖的顏色CGRect

iPhone控制項之UILabel

- (void)viewDidLoad { [super viewDidLoad]; CGRect labelFrame = CGRectMake(10,10,200,44); UILabel *myLabel = [[UILabel alloc] initWithFrame:labelFrame]; myLabel.backgroundColor = [UIColor clearColor]; myLabel.textColor = [UIColor

iPhone控制項之UIPickerView

1 #import <UIKit/UIKit.h>2 3 @interface UITestViewController : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate>4 {5 6 }7 8 @end 1 // 2 // UITestViewController.m 3 // UITest 4 // 5 6 #import "UITestViewController.h" 7 8

Xcode 4.1/4.2 免認證(iDP)開發+真機調試

開發環境使用的是目前為止最新的穩定版軟體:Mac OS X Lion 10.7 + Xcode

Cocoa設計模式之KVO

參考官方文檔:http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/KeyValueObserving/KeyValueObserving.html#//apple_ref/doc/uid/10000177-BCICJDHA看這個概念老久了,遲遲沒能真正的用到,今天總算是使用上了,回頭來把方法補上。大批大批的概念我就不贅述了,看官方最有效。三分步1、保證要添加觀察的類符合kvc2、為屬性添加觀察者

iPhone開發之NSURL

通過一個URL,擷取URL中包含的各種資訊。例如: NSURL *url = [NSURL URLWithString:@"http://some-site.com:999/dir1/dir2;param?field-1=value-1&field-2=value-2#anchor1"]; NSLog(@"Scheme: %@", [url scheme]); //方案 NSLog(@"Host: %@", [url host]); //主機

學習NHibernate時遇到的問題解決方案

一:用spring.NET及Nhibernate時, 在項目處添加Spring_bean.xml這個檔案,使用Spring.Context.IApplicationContext初始化時,例如:xmlFiles[0] = "assembly://SpringNHibernateSample/OKEC.Sample/Spring_bean.xml";IApplicationContext  context = new XmlApplicationContext(xmlFiles);

多線程之dispatch_queue_t

gcd非同步多線程操作使用流程,一般在子線程中處理資料,主線程更新介面static dispatch_queue_t loadDealersQueue = NULL; if (!loadDealersQueue) { loadDealersQueue = dispatch_queue_create("com.geelycar.loadactivity.loaddealersqueue", NULL); }

iPhone開發資源匯總(更新中)

參考來自:http://www.cocoachina.com/iphonedev/toolthain/2011/1019/3387.html如何用Facebook graphic api上傳視頻:http://developers.facebook.com/blog/post/532/Keychain儲存資料封裝:https://github.com/carlbrown/PDKeychainBindingsController對焦功能的實現:http://www.clingmarks.com/?

總頁數: 61357 1 .... 12397 12398 12399 12400 12401 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.