2016/11/16

【iOS】【swift3】コードからstoryboardに画面遷移する

Next.storyboard 、storyboard idはnext に遷移する場合
       let storyboard = UIStoryboard(name: "Next", bundle: nil)
       let nextVC = storyboard.instantiateViewController(withIdentifier: "next")
       self.present(nextVC, animated: true, completion: nil)


NavigationControllerを使う場合は
       let storyboard = UIStoryboard(name: "Next", bundle: nil)
       let nextVC = storyboard.instantiateViewController(withIdentifier: "next")
       let navigationController = UINavigationController(rootViewController: nextVC)
       self.present(navigationController , animated: true, completion: nil)

これでNavigation Barが表示される。

2016/10/31

Handlerを使った遅延処理

3秒後にdelayFunを実行
new Handler().postDelayed(delayFunc, 3000);

    private final Runnable delayFunc = new Runnable() {
        @Override
        public void run() {
            // 遅延処理
        }
    };

2016/06/17

styleでToolbarのタイトルの文字の色とhomeAsUpIndicator(戻る矢印)の色を変える

白に変える場合は
    

    

    

    

2016/06/15

traces.txt をPCに保存する

adb /data/anr/traces.txt

c:/android-sdk/platform-tools/traces.txt
または
ユーザー/(ユーザー名)/traces.txt
に保存される

2016/05/03

intent-filter について

Manifestでactionと一緒に記述しないと動かないもの

<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>



<intent-filter>
<action android:name="android.intent.action.PACKAGE_REPLACED" />
<data android:scheme="package" />
</intent-filter>

など


ただ、APIレベル12以降は
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter>
を使った方が便利