Time of Update: 2015-07-22
標籤:儲存圖片到相簿最近在深入的學習關於swift相關技術,雖然海做不出什麼好的東西,但是感覺收穫不少,相信總有一樣能用到,所以就總結了一下,希望大家喜歡!1.OC中的寫法在OC中,我們需要儲存圖片到相簿需要調用這個方法: 1 void UIImageWriteToSavedPhotosAlbum(UIImage *image, id completionTarget, SEL completionSelector, void
Time of Update: 2015-07-22
標籤:UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectZero];NSString *myUserAgent = [webView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];ios 獲得webview user-agent
Time of Update: 2015-07-22
標籤:ImageView有scaleType屬性可以縮放圖片,讓圖片鋪滿螢幕寬度,但是會出現壓縮或裁剪的情況。 ImageView的scaleType的屬性分別是matrix(預設)、center、centerCrop、centerInside、fitCenter、fitEnd、fitStart、fitXY android:scaleType="center" 保持原圖的大小,顯示在ImageView的中心。當原圖的size大於ImageView的size,超過部分裁剪處理。
Time of Update: 2015-07-22
標籤:ios xib strong weak iboutlet 有人問,在ARC下,IBOutlets到底應該定義成strong 還是 weak ?支援這個答案的人最多,答案僅是摘自官方文檔的一個片段: From a practical perspective, in iOS and OS X outlets
Time of Update: 2015-07-22
標籤:android 手機通訊錄 通訊錄搜尋 package contacters;import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map;import java.util.Map.Entry;import java.util.Random;public
Time of Update: 2015-07-22
標籤:封裝 多態 ios開發 objective-c 繼承 //// main.m// 繼承////#import <Foundation/Foundation.h>#import "Animal.h"#import "Cat.h"#import
Time of Update: 2015-07-22
標籤:mac eclipse sdk 翻牆 1.翻牆下載1.1.下載google的sdk,可以用紅杏翻牆。1.2.通過sdk manager更新下載sdk開發包,以前修改hosts檔案下載,現在沒有效果了,這次通過國內的鏡像進行下載。啟動 Android SDK Manager
Time of Update: 2015-07-22
標籤:安卓 android adapter getview convertview ListView是安卓中非常常用的一個控制項。安卓設計使用Adapter來對ListView進行管理。但是系統提供的Adapter無法滿足一些複雜的顯示情況,這個時候我們就需要使用BaseAdapter來自行實現ListView的控制。其他的方法
Time of Update: 2015-07-22
標籤:伺服器經常伺服器返回的資料,有null,還有nil,如果在模型層不處理的話,到時候資料展現時,一定會崩啊,最近決心要解決這個問題,所以查看了一些資料後,有答案了:- (id) setNoNull:(id)aValue{ if (aValue == nil) { aValue = @"";//為null時,直接賦空 } else if ((NSNull *)aValue == [NSNull null]) { aValue = @&
Time of Update: 2015-07-22
標籤:android 事件處理 教程 監聽 基礎 Android基礎入門教程——3.1.1 基於監聽的事件處理機制標籤(空格分隔): Android基礎入門教程本節引言:
Time of Update: 2015-07-22
標籤:相容手機 與PC 的一個外掛程式, 只是簡單的 向上,向下,向左,向右 的 。已經上傳我的檔案裡面。http://files.cnblogs.com/files/yjhua/touchwipe.js源碼如下:/* * ---------------------- * TouchWipe * ---------------------- * http://www.uedcool.com * by EddyZhang (張勇輝) * version 2.0
Time of Update: 2015-07-22
標籤: 1 int main(int argc, const char * argv[]) { 2 @autoreleasepool { 3 //OC數組 可以儲存不同類型的對象 只能儲存物件,基礎資料型別 (Elementary Data Type)是不能儲存的 4 //OC數組 儲存的是對象的指標 5 NSArray *array = [[NSArray alloc] initWithObjects:@"1",@"2",@"3",@"4
Time of Update: 2015-07-22
標籤:ios不能指定採用哪種定位方式,會根據裝置的情況和周圍的環境採用一套最佳的解決方案。再定位服務的應用中,第一次請求位置資訊時,系統會提示使用者是否允許開啟定位服務。Ios主要通過三個類來實現定位:1) CLLocationManager,用於定位服務管理類,它能夠給我們提供位置資訊和高度資訊。2) CLL
Time of Update: 2015-07-22
標籤:需求; 1.實現時間軸效果 2.資料顯示頂部為舊資料,底部為最新資料(說起來有點反正常iOS邏輯,但是這就是需求,認命吧~) 3.進入頁面時,直接滾動到最低部 4.部分Cell需要自適應 5.重新整理機制:底部為最新資料,向上滑到最底部時載入新的資料。向下滑動,動態載入舊資料。issus: 網路請求資料後,reloadData後。滾動到底部嘗試的解決辦法:1.滾動到底部: 解決辦法:
Time of Update: 2015-07-22
標籤:這道題以前寫過,bfs,用隊列,不多說了,上代碼:#include<stdio.h>#include<stdlib.h>#include<string.h>#include<queue>using namespace std;int map[10][10];int visit[10][10];int dist[10][10];int dx[8]={-2,-2,-1,-1,1,1,2,2};int dy[8]={-1,1,-2,2,-2,2,-
Time of Update: 2015-07-22
標籤:design-patternThe template method allow separate the generic method from a detail context(class) via inheritance Another advantage: 1.Inheritance implementation means that you will know the actual method implementation class before compilation,it
Time of Update: 2015-07-22
標籤:android 許可權 轉載請註明出處:http://blog.csdn.net/l1028386804/article/details/47010177
Time of Update: 2015-07-22
標籤: 1 int main(int argc, const char * argv[]) { 2 @autoreleasepool { 3 Person *p1 = [[Person alloc] initWithName:@"張三"]; 4 Person *p2 = [[Person alloc] initWithName:@"李四"]; 5 Person *p3 = [[Person alloc]
Time of Update: 2015-07-22
標籤:android-studio1,在build.grandle添加,其中規則寫在proguard-rules.pro中,也可以自訂一個檔案,將其代替,比如eclipse常用的 proguard-project.txtbuildTypes { release { signingConfig signingConfigs.release minifyEnabled true proguardFiles
Time of Update: 2015-07-22
標籤:File這是檔案基類,抽象地代表一個檔案實體,它有四個不同的構造方法: File(File dir, String name) File(String path) File(String dirPath, String name) File(URI