fragment 模型
来源:互联网 发布:印尼网络制式 编辑:程序博客网 时间:2024/06/05 19:35
/////////////////////////////////////布局//////////////////////////////////////
<RadioGroup android:layout_width="match_parent" android:layout_height="50dp" android:id="@+id/group" android:orientation="horizontal" android:layout_alignParentBottom="true" > <RadioButton android:layout_width="0dp" android:layout_height="match_parent" android:id="@+id/button1" android:layout_weight="1" android:button="@null" android:gravity="center" android:text="首页" /> <RadioButton android:layout_width="0dp" android:layout_height="match_parent" android:id="@+id/button2" android:layout_weight="1" android:button="@null" android:gravity="center" android:text="发现" /> <RadioButton android:layout_width="0dp" android:layout_height="match_parent" android:id="@+id/button3" android:layout_weight="1" android:button="@null" android:gravity="center" android:text="下载" /> <RadioButton android:layout_width="0dp" android:layout_height="match_parent" android:id="@+id/button4" android:layout_weight="1" android:button="@null" android:gravity="center" android:text="我的" /></RadioGroup><FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/frame" android:layout_above="@+id/group" ></FrameLayout>//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////主函数
group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) { switch (checkedId){ case R.id.button1: getSupportFragmentManager().beginTransaction().replace(R.id.frame,new One()).commit(); break; case R.id.button2: getSupportFragmentManager().beginTransaction().replace(R.id.frame,new Two()).commit(); break; case R.id.button3: getSupportFragmentManager().beginTransaction().replace(R.id.frame,new Three()).commit(); break; case R.id.button4: getSupportFragmentManager().beginTransaction().replace(R.id.frame,new Four()).commit(); break; } }});
阅读全文
0 0
- fragment 模型
- fragment的基本使用模型
- Cg入门19:Fragment shader - 片段级模型动态变色
- Fragment
- Fragment
- fragment
- Fragment
- Fragment
- Fragment
- Fragment
- fragment
- fragment
- Fragment
- Fragment
- fragment
- Fragment
- Fragment
- Fragment
- Recyclerview adapter
- python __name__ == '__main__'
- 死锁(python 版)
- 数字验证码
- 2017互联网+智慧中国年会 众多嘉宾震撼来袭
- fragment 模型
- Python-Pandas 如何shuffle(打乱)数据?
- 在AndroidStudio上搭建 Kotlin 开发环境
- MySQL开发标准规范
- 反射main方法
- windows上添加自动监控apache服务
- JSON.parse()和JSON.stringify()
- VMware安装Ubuntu 16.04
- 解决react-native的Navigator跳转不刷新页面的问题