IOS 隨筆記錄

來源:互聯網
上載者:User

標籤:

一、IOS 關閉鍵盤:

1、讓所有控制項的鍵盤隱藏

// 這個方法可以讓整個view取消第一響應者,從而讓所有控制項的鍵盤隱藏[self.view endEditing:YES];

2、讓某個textFiled的取消第一響應者

// 讓某個textFiled的取消第一響應者[textField resignFirstResponder];
二、IOS 動畫:(transform 屬性)

1、透明度 ,取值範圍0~1.0(透明~不透明)。

// 透明度 ,取值範圍0~1.0(透明~不透明)。_btn.alpha = 1.0f;

2、旋轉

// 固定左旋45°_btn.transform = CGAffineTransformMakeRotation(- M_PI_4);// 每次執行都在原來基礎上旋轉45度_btn.transform = CGAffineTransformRotate(_btn.transform, M_PI_4 );

3、縮放

// 縮放0.8_btn.transform = CGAffineTransformMakeScale(0.8, 0.8);// 在原來基礎上縮放0.8_btn.transform = CGAffineTransformScale(_btn.transform, 0.8, 0.8);

4、清空之前所有的形變狀態(消除以前的旋轉、縮放等狀態)

_btn.transform = CGAffineTransformIdentity;

5、常用方法

// 方法一:0.3 表示執行時間[UIView animateWithDuration:0.3 animations:^{      // 執行動畫代碼}];// 方法二:0.3 表示執行時間[UIView animateWithDuration:0.3 animations:^{      // 執行動畫代碼} completion:^(BOOL finished) {      // 上面的動畫執行完畢後執行}];
三、解析plist檔案來建立數組對象
NSBundle *bundle = [NSBundle mainBundle]; // C++NSString *path = [bundle pathForResource:@"descs" ofType:@"plist"];_allDescs = [NSArray arrayWithContentsOfFile:path];

 

IOS 隨筆記錄

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.