0
<RelativeLayout> 
    <android.support.v7.widget.CardView> 
    . 
    .//this card view is showing 
    . 
    </android.support.v7.widget.CardView> 

    <ScrollView> 

      <RelativeLayout> 


       <android.support.v7.widget.CardView> 
        . 
        .//this card view is not showing 
        . 
        </android.support.v7.widget.CardView> 

        <android.support.v7.widget.RecyclerView> 

        //data is previewing but not scrolling 

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

     </RelativeLayout> 


    </ScrollView> 



</RelativeLayout> 

但是,如果我把第二個cardview以外的scrollview比顯示。我沒有得到什麼問題。如果有人能提供幫助,非常感謝。卡片查看不出現,也滾動視圖不工作

解決方案我曾嘗試: -

使用nestedscrollview而不是滾動視圖。

如果問題格式或樣式與Stack Overflow指南不匹配,請告訴我,以便將來我會以更好的方式提出問題。而不是投下它。

編輯:

完整的XML文件:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 

xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 


<android.support.v7.widget.CardView 
    android:id="@+id/goal_status_card" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

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

     <TextView 
      android:textAppearance="@style/Base.TextAppearance.AppCompat.Large" 
      android:id="@+id/goal_name" 
      android:textAlignment="center" 
      android:text="Blood Pressure" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" /> 

     <LinearLayout 
      android:layout_marginTop="@dimen/activity_horizontal_margin" 
      android:weightSum="3" 
      android:orientation="horizontal" 
      android:id="@+id/goal_brief" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <customView.timeline_segement 
       android:layout_weight="1" 
       android:layout_width="100dp" 
       android:layout_height="wrap_content"> 

      </customView.timeline_segement> 

      <customView.timeline_segement 
       android:layout_weight="1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content"> 

      </customView.timeline_segement> 

      <customView.timeline_segement 
       android:layout_weight="1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content"> 

      </customView.timeline_segement> 

     </LinearLayout> 

    </LinearLayout> 


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


<ScrollView 
    android:fillViewport="true" 
    android:layout_below="@+id/goal_status_card" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <RelativeLayout 
     android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 


     <android.support.v7.widget.CardView 
      android:layout_margin="@dimen/activity_horizontal_margin" 
      android:id="@+id/goal_card_team" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

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

       <TextView 
        android:text="Your Care Team" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" /> 

       <LinearLayout 
        android:weightSum="3" 
        android:orientation="horizontal" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent"> 

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

         <ImageView 
          android:id="@+id/doctor_photo" 
          android:layout_width="wrap_content" 
          android:layout_height="60dp" /> 

         <TextView 
          android:textAlignment="center" 
          android:id="@+id/doctor_name" 
          android:text="Dr Ankur" 
          android:layout_width="match_parent" 
          android:layout_height="match_parent" /> 

        </LinearLayout> 


        <ImageView 
         android:src="@drawable/applozic_ic_action_add" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" /> 

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

         <ImageView 
          android:id="@+id/care_manager_photo" 
          android:layout_width="wrap_content" 
          android:layout_height="60dp" /> 

         <TextView 
          android:textAlignment="center" 
          android:id="@+id/care_manager_name" 
          android:text="Cm Ankit" 
          android:layout_width="match_parent" 
          android:layout_height="match_parent" /> 

        </LinearLayout> 



       </LinearLayout> 


      </LinearLayout> 


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

     <android.support.v7.widget.RecyclerView 
      android:layout_below="@+id/goal_card_team" 
      android:id="@+id/action_list" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

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

    </RelativeLayout> 


</ScrollView> 

任何人都可以幫我這個?

+1

在您的啓動代碼中,將此'修復爲此<'RelativeLayout>'',您在'Relative'和'Layout'之間添加了空格。 – Ironman

+0

這是錯字錯誤。我修好了。 @Ironman ..感謝指出它。 –

+0

現在檢查它是否工作? – Ironman

回答