Time of Update: 2015-07-01
標籤:android開發中經常會用到各種各樣的監聽器,android監聽器的寫法與java又有不同的地方; 1,activity中使用內部類實現介面 ,建立內部類執行個體 使用add方法 與java類似建立監聽器的執行個體myLis lis = new
Time of Update: 2015-07-01
標籤:今天想實現這個功能,但只是利用現有的onTouchEvent和GestureDetector感覺做起來有些糾結,原來好像也嘗試過,最後搞的程式有點亂,不好維護,那麼就利用一下Android程式員最大的優勢——源碼。 首先想到的ListView既支援點擊又支援拖動,就去看源碼,首先找的突破點就是:
Time of Update: 2015-07-01
標籤:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the
Time of Update: 2015-07-01
標籤:發送通知: UILocalNotification *newNotification = [[UILocalNotification alloc] init]; if (newNotification) {//時區 newNotification.timeZone=[NSTimeZone defaultTimeZone];//推送事件---10秒後
Time of Update: 2015-07-01
標籤:當我們擷取到一些iOS的app包後,發現裡面的png圖片使用系統的預覽看不了。因為在Xcode產生應用程式套件組合時,自動將png圖片進行最佳化,而最佳化後的圖片不能直接使用預覽查看,這個最佳化工具是pngcrush。它也提供了還原的功能,使圖片再度可見。批量處理指令碼如下:#/bin/shfilelist=`find $1 -name "*.png"`#echo "$filelist"echo "$filelist"|while read filedoecho
Time of Update: 2015-07-01
標籤:在開發項目的時候,我們經常會遇到一些問題,除了設定一些Activity的啟動模式之外,好需要得到這個類是否被啟動過,判斷某一個類是否存在任務棧裡面這個時候,我們就可以用到下面的方法:/** * 判斷某一個類是否存在任務棧裡面 * @return */ private boolean isExsitMianActivity(Class<?> cls){ Intent intent = new Intent(this, cls);
Time of Update: 2015-07-01
標籤:ios cocoapods 類庫 cocoapods是非常優秀的IOS包管理工具,用來管理第三方組件, 完美解決第三方類庫庫更新, 相互間依賴等關係. 參考cocoapods首頁.安裝一般換成國內的source會比較方便.sudo gem install cocoapods //會被牆掉。 gem sources --remove https://rubygems.org/ gem
Time of Update: 2015-07-01
標籤:以下內容轉載自:http://www.cnblogs.com/flyFreeZn/p/4264220.html 本文來源於我個人的ARC學習筆記,旨在通過簡明扼要的方式總結出iOS開發中ARC(Automatic Reference
Time of Update: 2015-07-01
標籤:activity是android中使用非常平凡的一種組件,我們除了需要掌握activity中的生命週期以外,還需要掌握activity中的其他設定。1.activity 中主題的設定 android中我們可以通過AndroidManifest.xml中設定activity中的主題,其實android提供了許多內建的主題樣式,如下:android:theme="@android:style/Theme.Dialog"
Time of Update: 2015-07-01
標籤:轉載請註明出處:http://blog.csdn.net/lskshz/article/details/25364909一.介紹HandlerThread繼承自Thread,當線程開啟時,也就是它run方法運行起來後,線程同時建立了一個含有訊息佇列的Looper,並對外提供自己這個Looper對象的get方法,這就是它和普通Thread唯一不同的地方。 二.好處為什麼要使用HandlerThread。1.開發中如果多次使用類似new
Time of Update: 2015-07-01
標籤:1、public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } 在點擊請求的是連結是才會調用,重寫此方法返回true表明點擊網頁裡面的連結還是在當前的webview裡跳轉,不跳到瀏覽器那邊。2、public void onReceivedSslError(WebView view, SslErrorHandler
Time of Update: 2015-07-01
標籤:Android清除本機資料緩衝代碼案例直接上代碼:/* * 文 件 名: DataCleanManager.java * 描 述: 主要功能有清除內/外緩衝,清除資料庫,清除sharedPreference,清除files和清除自訂目錄 */ package com.test.DataClean; import java.io.File; import android.content.Context; import android.os.Environment; /**
Time of Update: 2015-07-01
標籤:kvo聽說過,之前一直沒怎麼用,最近用到啦,就學習了一下。demo介紹:有倆個viewcontroller(a和b),b裡有個定時器和一個button,b push到a,a裡的textview和label來展示b裡屬性str變化的值。代碼:bController.m@property (strong,nonatomic)aController * aView;@property (assign,nonatomic)int str; - (void)viewDidLoad
Time of Update: 2015-07-01
標籤:通常情況下多數應用程式都會將緩衝的位置選擇為 /sdcard/Android/data/<application package>/cache 這個路徑。選擇在這個位置有兩點好處:第一,這是儲存在SD卡上的,因此即使緩衝再多的資料也不會對手機的內建儲存空間有任何影響只要SD卡空間足夠就行。第二,這個路徑被Android系統認定為應用程式的緩衝路徑,當程式被卸載的時候,這裡的資料也會一起被清除掉,這樣就不會出現刪除程式之後手機上還有很多殘留資料的問題。//路徑例如:
Time of Update: 2015-07-01
標籤:UIView的提供了這個方法:- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event;1.建立CustomView繼承自UIView :CustomView.h@property (strong,nonatomic)NSArray * passthroughViews;@property (nonatomic)BOOL testHits; -(BOOL) isPassthroughView: (UIView*)
Time of Update: 2015-07-01
標籤:http://advertising.microsoft.com/en/blog/33906/microsoft-expands-partnerships-with-aol-and-appnexus-bing-to-power-search-for-aol-properties "AOL will become our seller of all display formats, including mobile and video, for the Microsoft
Time of Update: 2015-07-01
標籤:安卓中實現左右對齊,中間fill_parent的方法Java代碼: <?xml version="1.0″ encoding="utf-8″?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" &
Time of Update: 2015-07-01
標籤:DES 支援8位加密解密,3Des支援24位,Aes支援32位。3Des是Des演算法做三次。位元的單位是位元組byte,不是bits。3Des是把24位分成3組,第一組八位用來加密,第二組8位用於解密,第三組8位用於加密,所以,如果秘鑰為123456781234567812345678(3組1-8),則相當於做了一次12345678的Des加密。例如:第一次用12345678秘鑰對123進行加密得到
Time of Update: 2015-07-01
標籤:
Time of Update: 2015-07-01
標籤:ios擷取類的成員變數(ios)unsignedintnumIvars;Ivar*vars = class_copyIvarList(NSClassFromString(@"TestView"), &numIvars);NSString*key=nil;for(inti = 0; i < numIvars; i++) { Ivar thisIvar = vars[i];