Time of Update: 2018-07-24
我們有時候在點擊tabBaritem,是需要登入判斷,那我們該如何進行判斷呢,好比點擊購物車,我們需要使用者判斷登入我們要怎麼判斷呢這個就要用到TabBarController裡的一個協議方法例如: #pragma mark 判斷是否登入若沒登入跳轉到登入頁面 - (BOOL)tabBarController:(UITabBarController *)tabBarController
Time of Update: 2018-07-24
1.建立project,拖出兩個imageview和兩個button,分別關聯代碼 2.button action中加入 - (IBAction)save:(id)sender { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
Time of Update: 2018-07-24
應用中需要提取圖片的一部分來進行顯示,研究了一晚上也沒搞清楚雜整的,只有求助於google了,xamain的forum中找有人把辦法貼出來了。 Mark 一下。 參考:http://forums.xamarin.com/discussion/4170/resize-images-and-save-thumbnails // resize the image to be contained within a maximum width and height,
Time of Update: 2018-07-24
先來看兩張圖吧 1、 2、 出現這種情況的時候我嚇得一尿,然後用自己的手機親自測了一遍(iOS10.2.1),並沒有發現此類問題,再拿同事手機測試(iOS11.2.1),也沒有出現此類問題。 自己測試是測不出來的。然後詢問市場人員,根據詢問市場人員得知關於客戶手機的資訊為:iPhone 6 iOS8.1.1,然後立馬用模擬器跑了一遍發現果然有此類現象。 然後上網搜尋了一些文章,通過測試發現這是xcode的問題 解決方案
Time of Update: 2018-07-24
1、自訂UISearchBar的子類MySearchBar,重寫layoutSubviews方法。 代碼: - (void)layoutSubviews {[super layoutSubviews];for (UIView *view in self.subviews){if ([view isKindOfClass:NSClassFromString(@"UIView")] && view.subviews.count > 0) {for (
Time of Update: 2018-12-03
1.需要支援庫MediaPlayer.framework2.代碼MPMoviePlayerController *mPlayer = [[MPMoviePlayerController alloc] init];//視頻地址 本地NSString *path = [[NSBundle mainBundle] pathForResource:@"filename" andType:@"filetype"];NSURL *url = [NSURL
Time of Update: 2018-12-03
========== (one) UIImage 映像 等比例縮放==================================PicAfterZoomWidth:縮放後圖片寬 PicAfterZoomHeight:縮放後圖片高 (預定義)#define PicAfterZoomWidth 320#define PicAfterZoomHeight 480+ (UIImage *)getPicZoomImage:(UIImage *)image { UIImage *img =
Time of Update: 2018-12-03
網路上有很多文章介紹iOS開發人員帳號註冊過程,大都差不多。我參考了 http://blog.csdn.net/xdonx/article/details/7330107
Time of Update: 2018-12-03
UIImage *srcimg = [UIImage imageNamed:@"test.png"];////test.png寬172 高192NSLog(@"image width = %f,height = %f",srcimg.size.width,srcimg.size.height);UIImageView *imgview = [[UIImageView alloc] init];imgview.frame = CGRectMake(10, 150, 300,
Time of Update: 2018-12-03
剛剛更新過的代碼出現了問題,在上傳之前的驗證就不通過,提示 Apps are not permitted to access the UDID and must not use the uniqueIdentifier method of UIDevice. Please update your apps and servers to associate users with the Vendor or Advertising identifiers introduced in iOS
Time of Update: 2018-12-03
問題描述: 最近在做一個項目,需要做一個含有圖片資源得靜態庫.a,但是蘋果提供得靜態庫工程無法將圖片資源匯入,只能通過外加.bundle檔案的方式,這樣在調試階段也需要使用bundle檔案,而每次更新bundle檔案的內容時都需要重新編譯bundle工程,產生新的bundle檔案。解決方案: 在圖片資源不多的時候,其實可以將圖片轉換成base64的string,通過static方式儲存。需要用的時候再通過base64解析成data,最後完成顯示。NSString
Time of Update: 2018-12-04
在查資料的時候無意間看見無限互聯iOS開發視頻教程,很好的資源,分享給需要的iOS開發人員們;資源來自 懶人ios程式碼程式庫-www.lanrenios.com視頻目錄:無限互聯iOS開發視頻教程:1.1.iPhone開發概述-必看-熊彪.mov(294.86MB)無限互聯iOS開發視頻教程:2.1.iPhone開發工具安裝及介紹-熊彪.mov(170.63MB)無限互聯iOS開發視頻教程:2.2.OC變數和基礎資料型別 (Elementary Data Type)1-熊彪.mov(128.4
Time of Update: 2013-12-10
Time of Update: 2013-12-10
- (void) recordVideo: (id) sender { UIImagePickerController *ipc = [[UIImagePickerController alloc] init]; ipc.sourceType = UIImagePickerControllerSourceTypeCamera; ipc.delegate = self; ipc.allowsEditing =
Time of Update: 2013-12-10
因為介面美化的需要,原有的控制項SearchBar控制項太醜了,又懶的研究SearchBar控制項的新樣式,所以決定重寫個搜尋功能的控制項。建立個UITextField的類對象。[cpp] searchField= [[[UITextField alloc]initWithFrame:CGRectMake(0,5,320,36)] autorelease]; searchField.textColor= [UIColorcolor WithRed:0.0/255.0 green:103
Time of Update: 2013-12-10
SQLite是MySQL的簡化版,更多的運用與行動裝置或小型裝置上。SQLite的優點是具有可移植性,它不需要伺服器就能運行,同時,它也存在一些缺陷,首先,沒有提供簡單的資料庫建立方式,必須手工建立資料庫,其次,SQLite沒有物件導向介面,必須使用依賴於C語言代碼的API。相對於OC,這套API既不那麼優雅,也更難使用。當相比於用檔案進行儲存,還是更推薦使用SQLite進行資料存放區。 下面來看下如何使用SQLite 工程目錄如下: 首先建立一個Single
Time of Update: 2013-12-10
1、常見的NSFileManager檔案方法-(NSData *)contentsAtPath:path //從一個檔案讀取資料-(BOOL)createFileAtPath: path contents:(NSData *)data attributes:attr //向一個檔案寫入資料-(BOOL)removeItemAtPath:path error:err //刪除一個檔案-(BOOL)moveItemAtPath:from toPath:to
Time of Update: 2013-12-10
1 前言使用Quartz 2D繪圖時候,我們常會用到UIView的子類,想該類的drawRect:方法中添加Quartz函數調用。每次需要重繪視圖時候都會調用該方法。2 詳述在Quartz 2D中,和其他Core Graphics中一樣,繪圖是在圖形上下文中進行的,通常,只稱上下文。繪圖時候,我們需要檢索當前上下文,使用此上下文進行各種Quartz圖形調用,並且讓此上下文負責將圖形呈現到視圖上。下面代碼將檢索當前上下文:CGContextRef context =
Time of Update: 2013-12-10
1 前言這節我們將用一個簡單的應用:繪圖應用,我們叫他TouchPainter。來展示設計模式和最佳做法,希望能從中得到啟發。2 詳述2.1 設計過程中的3個重要裡程碑2.1.1 想法的概念化彙集有關TouchPainter應用的一些基本需求和用例,比如使用者應該怎樣使用,以及使用者使用時的體驗。2.1.2
Time of Update: 2013-12-10
發起: 回調方法時間: 1、接收完HTTP協議頭,開始真正接手資料時候調用,一般在這個方法裡初始化一些儲存資料的對象如NSMutableData;- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response2