如何自动添加图像到bootstrap轮播

时间:2016-03-12 16:07:19

标签: twitter-bootstrap-3

有没有办法让bootstrap carousel从文件夹中自行添加图像?我试过谷歌搜索,但我找不到任何东西。我目前正在使用你在Dreamweaver中获得的标准轮播

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    //Set your toolbar in your MainActivity
    Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    FragmentManager fragmentManager=getFragmentManager();
    FragmentTransaction transaction=fragmentManager.beginTransaction();

    if(yourOwnConditionToReplaceFragment()){
        FragmentOne fragmentOne=new FragmentOne();
        //Notice the id passed in replace function it will make sure that FrameLayout is replaced so fragment will occupy only that portion of screen that is taken by FrameLayout in activity_main.xml
        transaction.replace(R.id.fragment_container,fragmentOne);
    }else{
        FragmentTwo fragmentTwo=new FragmentTwo();
        transaction.replace(R.id.fragment_container,fragmentTwo);
    }

    transaction.commit();
}

0 个答案:

没有答案