安卓开发教程fragment(安卓入门教程十五)
安卓开发教程fragment(安卓入门教程十五)<fragmentandroid:id="@ id/fragment1"}Viw v = inflater.inflate(R.layout.fragment null);returnv;}
Fragment概述Fragment可以被嵌入到Activity中,一个Activity可以有多个Fragment。
publicclassMyFragmentextendsFragment{
@Override
publicc ViewonCreateView(LayoutInflater inflater ViewGroup container Bundle savedInstanceState){
Viw v = inflater.inflate(R.layout.fragment null);
returnv;
}
}
静态加载android:id="@ id/fragment1" android:name="fragment" android:layout_width="wrap_content" android:layout_height="wrap_content"<fragment
/>
Fragmenttransaction transaction = fragmentManager.beginTransaction(); WAMP WAMP集合了Apache PHP Mysql,哈哈。FragmentManager fragmentManager = getFragmentManager();