亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何使用TabLayout在Fragment中使用CardView行實現RecyclerView

如何使用TabLayout在Fragment中使用CardView行實現RecyclerView

函數式編程 2019-08-16 16:31:54
如何使用TabLayout在Fragment中使用CardView行實現RecyclerView我想在一個使用TabLayout的Activity中實現一個ListFragment,這樣我就可以在不同的列表之間滑動。最后它應該成為一個預訂應用程序,以便您可以選擇不同的學科,并預訂一個特定的時間段。然而到目前為止,我只實現了ListActivity或標簽活動(android studio中的標準活動),但不是兩者。如果有人可以提供幫助,我會很高興的。標簽式活動:public class Diciplines extends AppCompatActivity {     /**      * The {@link android.support.v4.view.PagerAdapter} that will provide      * fragments for each of the sections. We use a      * {@link FragmentPagerAdapter} derivative, which will keep every      * loaded fragment in memory. If this becomes too memory intensive, it      * may be best to switch to a      * {@link android.support.v4.app.FragmentStatePagerAdapter}.      */     private SectionsPagerAdapter mSectionsPagerAdapter;     /**      * The {@link ViewPager} that will host the section contents.      */     private ViewPager mViewPager;     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_diciplines);         Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);         setSupportActionBar(toolbar);         // Create the adapter that will return a fragment for each of the three         // primary sections of the activity.         mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());         // Set up the ViewPager with the sections adapter.         mViewPager = (ViewPager) findViewById(R.id.container);         mViewPager.setAdapter(mSectionsPagerAdapter);         FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);         fab.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View view) {                 Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)                         .setAction("Action", null).show();             }         });     }
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 489 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號