Gần đây tôi đã bắt đầu rối tung với các thành phần mới của AppCompat 21 và triển khai Thiết kế Material Design. Hiện tại, tôi có một ActionBarActivity với một Thanh công cụ và đang cố gắng để nó lưu trữ một đoạn có chứa một RecyclerView của các mục TextView (chỉ để kiểm tra Recycler). Tôi có các mục được hiển thị, nhưng các văn bản trong mỗi điểm được cắt đứt và toàn bộ Recycler là bao gồm các thanh công cụ như vậy:Nội dung phân đoạn đang che phủ Thanh công cụ
Như bạn có thể thấy, có ba TextView. Văn bản của họ bị cắt nửa chừng và nó che phủ Thanh công cụ (không có Tiêu đề tôi biết). Bố cục mục TextView được chứa trong một bố cục RecyclerView, đó là bố cục của Phân đoạn. Hoạt động gốc có FrameLayout -> Toolbar, FrameLayout. Tôi đang chèn Fragment vào FrameLayout phụ của Activity. Đây là XML:
Mỗi xem trong Recycler:
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/textview"
android:layout_width="match_parent"
android:layout_height="48dp"
android:fontFamily="sans-serif"
android:paddingTop="16dp"
android:paddingBottom="20dp"
android:textSize="16sp"/>
Cách bố trí Recycler, đó là cách bố trí của các Fragment:
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/recycler_tasks"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="stuff.MainActivity$TaskFragment">
</android.support.v7.widget.RecyclerView>
Và bố trí các Hoạt động của cha mẹ:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
tools:ignore="MergeRootFrame">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</FrameLayout>
Tôi biết nó phải là một cái gì đó đơn giản nhưng tôi đã stumped trên nó một lúc, cố gắng những thứ khác nhau để không ava Il.
này nên là câu trả lời đúng ... – josemigallas