1

학생과 관련된 데이터가 포함 된 접을 수있는 툴바를 만들었습니다. 제 문제는 마지막 선형 레이아웃이 표시되지 않는다는 것입니다. 텍스트보기가 표시되지 않습니다.

enter <?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:fitsSystemWindows="true"> 

<android.support.design.widget.AppBarLayout 
    android:id="@+id/app_bar_layout" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
    android:fitsSystemWindows="true"> 

    <android.support.design.widget.CollapsingToolbarLayout 
     android:id="@+id/collapsing_toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_scrollFlags="scroll|exitUntilCollapsed" 
     app:contentScrim="?attr/colorPrimary" 
     app:expandedTitleMarginStart="48dp" 
     app:expandedTitleMarginEnd="64dp" 
     android:fitsSystemWindows="true"> 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 
      <SearchView 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/search_user" 

       /> 

      <ImageView 
       android:layout_width="110dp" 
       android:layout_height="110dp" 
       android:src="@drawable/person" 
       android:layout_centerHorizontal="true" 
       android:id="@+id/display_picture" 
       android:layout_below="@+id/search_user"/> 



      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:gravity="center" 
       android:layout_below="@+id/display_picture" 
       android:id="@+id/linear_name"> 
       <TextView 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:layout_weight="1" 
        android:textColor="#FFF" 
        android:textSize="20dp" 
        android:textStyle="bold" 
        android:gravity="right" 
        android:text="First Name here " 
        android:id="@+id/tvDisplayFName" /> 
       <TextView 
        android:layout_width="fill_parent" 
        android:textColor="#FFF" 
        android:layout_height="wrap_content" 
        android:textSize="20dp" 
        android:textStyle="bold" 
        android:layout_weight="1" 
        android:gravity="left" 
        android:text=" Last Name here" 
        android:id="@+id/tvDisplayLName" /> 
      </LinearLayout> 
      <LinearLayout 
       android:layout_width="match_parent" 
       android:textColor="#FFF" 
       android:layout_height="wrap_content" 
       android:gravity="center" 
       android:layout_below="@+id/linear_name" 
       android:id="@+id/linear_branch_year"> 
       <TextView 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:layout_weight="1" 
        android:textColor="#FFF" 
        android:text="Branch here " 
        android:gravity="right" 
        android:layout_below="@+id/linear_name" 
        android:id="@+id/tvDisplayBranch" /> 
       <TextView 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:layout_weight="1" 
        android:text=" Year here" 
        android:textColor="#FFF" 
        android:id="@+id/tvDisplayYear" /> 
      </LinearLayout> 
      <TextView 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:textColor="#FFF" 
       android:layout_weight="1" 
       android:layout_below="@+id/linear_branch_year" 
       android:gravity="center" 
       android:text="Section here" 
       android:id="@+id/tvDisplaySection" /> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:textColor="#FFF" 
       android:gravity="center" 
       android:layout_below="@+id/tvDisplaySection" 
       android:id="@+id/linear_post_rate"> 
       <TextView 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:layout_weight="1" 
        android:textColor="#FFF" 
        android:text="Posts" 
        android:gravity="center" 
        android:id="@+id/tvDisplayPosts" /> 
       <TextView 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:layout_weight="1" 
        android:textColor="#FFF" 
        android:gravity="center" 
        android:text="Rate" 
        android:id="@+id/tvDisplayRating" /> 
      </LinearLayout> 
      <LinearLayout //NOT SHOWING 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:textColor="#FFF" 
       android:gravity="center" 
       android:layout_below="@+id/linear_post_rate" 
       android:id="@+id/linear_value"> 
       <TextView 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:layout_weight="1" 
        android:textColor="#FFF" 
        android:text="Posts" 
        android:gravity="center" 
        android:id="@+id/tvPostsValue" /> 
       <TextView 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:layout_weight="1" 
        android:textColor="#FFF" 
        android:gravity="center" 
        android:text="Rate" 
        android:id="@+id/tvRatingValue" /> 
      </LinearLayout> 

     </RelativeLayout> 


     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
      app:layout_collapseMode="pin" /> 

    </android.support.design.widget.CollapsingToolbarLayout> 

</android.support.design.widget.AppBarLayout> 

<android.support.v4.widget.NestedScrollView 
    android:id="@+id/scroll" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:clipToPadding="false" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior"> 


    <android.support.v7.widget.CardView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="24dp" 
     app:cardElevation="6dp" 
     app:cardUseCompatPadding="true"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical"> 

      <TextView 
       android:id="@+id/description" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_margin="30dp" 
       android:text="@string/large_text" 
       android:textAppearance="@style/TextAppearance.AppCompat.Body1"/> 

     </LinearLayout> 

    </android.support.v7.widget.CardView> 


</android.support.v4.widget.NestedScrollView> 

식 linear_value와 선형 레이아웃

도시 얻는 것은 아니다. 무엇이 문제 일 수 있습니까?

답변

1

AppBarLayout.

<android.support.design.widget.AppBarLayout 
    android:id="@+id/app_bar_layout" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
    android:fitsSystemWindows="true"> 

레이아웃 데이터가 표시되지 않는 경우 특정 높이를 지정하십시오. 그것을 바꿔.

<android.support.design.widget.AppBarLayout 
     android:id="@+id/app_bar_layout" 
     android:layout_width="match_parent" 
     android:layout_height="350dp" 
     android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
     android:fitsSystemWindows="true"> 
+0

문제가 해결되었지만 왜 그런 일이 발생 했습니까? – TeeKay