0
我想進行配置文件視圖(見下文)。 如何在視圖尋呼機內添加內容。我不能看到內容
目前我有與個人資料照片和兩個選項卡(日記和朋友)的看法。
這是我的活動佈局,其中包含兩個選項卡。
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/base_background"
android:id="@+id/app_bar">
<include layout="@layout/dog_profile" />
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/dog_header"
android:background="@color/base_background"
app:tabGravity="fill"
app:tabMode="fixed" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/primary"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</RelativeLayout>
這是我的日記片段,但我不能看到日記片段中任何東西。它可能在左上角。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_below="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:background="@color/accent"
android:layout_alignParentBottom="true"/>
<TextView
android:id="@+id/tv_no_memories"
style="@style/NoItemsStyle"
android:text="@string/no_memories" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
style="@style/FabStyle"/>
</RelativeLayout>
我不知道我應該改變,我可以看到的片段裏面的內容。
在我的活動我設置視圖尋呼機這樣
ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
adapter.addFragment(new DogDiaryFragment(), tab1);
adapter.addFragment(new DogFriendsFragment(), tab2);
viewPager.setAdapter(adapter);
tabLayout.setupWithViewPager(viewPager);
感謝我通過改變相對佈局與在活動XML垂直方向的線性佈局解決任何意見
添加一些java代碼或錯誤,如果你正在... – androidnoobdev
我已經添加了java代碼。我沒有收到任何錯誤,我不能看到內容。我認爲我錯誤地設置了日記片段。 – user3637775