LoginSignup
2
0

More than 5 years have passed since last update.

master of fragment の読書感想文

Posted at

master of fragment

PC整理してたら見つけた

画面遷移

  • 同階層の画面遷移の場合のみFragmentで画面遷移を実装した方が良い

  • Activity直下のFragmentに関するトランザクションはActivityで行うのが良い

  • Fragmentはコンポーネントとして再利用できるようになってるべき

Fragmentの入れ子

public class MainParentFragment extends Fragment {
  public void addChildFragment() {
    MainChildFragment f = new MainChildFragment();
    getChildFragmentManager().beginTransaction().
  }
}

DialogFragment

すぐに消えてもいいDialogはAlertDialogを使う
勝手に消えたら困るDialogはDialogFragmentを使う

スプラッシュはFragmentの方が良い

FragmetTransactionで入れ替えるFagmentはレイアウトXMLで定義してはいけない

FragmentTransaction で入れ替える Fragment はコードから生成するよう
にしてください。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0