fragment采用的是动态加载方式,底部采用radiogroup
public class MainActivity extends AppCompatActivity {
@BindView(R.id.vp)
ViewPager vp;
@BindView(R.id.radio_button_home)
RadioButton radioButtonHome;
@BindView(R.id.radio_button_shop)
RadioButton radioButtonShop;
@BindView(R.id.radio_button_mine)
RadioButton radioButtonMine;
@BindView(R.id.radio_group_bottom)
RadioGroup radioGroupBottom;
private Unbinder bind;
private List<Fragment> list;
private HomeFragment homeFragment;
private ShoppingFragment shoppingFragment;
private MineFragment mineFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
bind = ButterKnife.bind(this);
initView();//布局的加载
// initData();
}
private void initView() {
list = new ArrayList<>();
homeFragment = new HomeFragment();
shoppingFragment = new ShoppingFragment();
mineFragment = new MineFragment();
list.add(homeFragment);
list.add(shoppingFragment);
list.add(mineFragment);
//