2015年9月3日 星期四

[iOS]退出App動畫

Objective-C:


        UIWindow *window = [UIApplication sharedApplication].delegate.window;
        [UIView animateWithDuration:1.0f animations:^{
            window.alpha = 0;
            window.frame = CGRectMake(window.bounds.size.width / 2, window.bounds.size.height / 2, 0, 0);
            } completion:^(BOOL finished) {
            exit(0);
        }];

Swift:

        let window:UIWindow = ((UIApplication.sharedApplication().delegate?.window)!)!
        UIView.animateWithDuration(1, animations: {
            window.alpha = 0
            window.frame = CGRectMake(window.bounds.size.width / 2, window.bounds.size.height / 2, 0, 0)
            }, completion: {
                void in exit(0)
        })


reference:http://blog.eyrefree.org/articles/153.html

2015年8月25日 星期二

[iOS]Xcode 6 Disable ARC 設定

Disable ARC 
Build Settings  -> Search Automatic Reference Counting ->  NO


Disable ARC on single files
Build phases -> compile sources double click on the file and enter:
-fno-objc-arc 


2015年5月9日 星期六

[Android]嵌入Admob

step1:註冊AdMob http://www.google.com.tw/ads/admob/
























step2:選擇應用程式




step3:設定廣告樣式


step4:建立新的project

平台 SDK 版本至少為 9,Google Mobile Ads SDK 支援的最低版本

step5:下載Google 儲存庫

step5:設定 build.gradle


step6:修改AndroidManifest.xml

step7:設定廣告單元編號strings.xml




step8:在廣告顯示頁面layout中加入AdView


step9:在Activity.java 中載入廣告



source code:https://github.com/YehHuaChen/AdMob

[iOS]退出App動畫

Objective-C:         UIWindow *window = [UIApplication sharedApplication].delegate.window;         [UIView animateWi...