2015-03-06 2 views
0

Я буду использовать ScrollView в RecycleView. К сожалению, страница будет прокручиваться. Но содержание свитка, не прокручиваяКак установить ScrollView в RecycleView

мой RecyclerView код является:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" 
android:background="#B0BEC5"> 

<include 
    android:id="@+id/app_bar" 
    layout="@layout/app_bar_tanz" /> 

<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="48dp" 
    android:background="@color/smiley_category"> 

    <RelativeLayout 
     android:id="@+id/select_smiley" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <RelativeLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_toLeftOf="@id/layer_smiley"> 

      <TextView 
       android:id="@+id/main_text_smiley" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerInParent="true" 
       android:text="@string/title_smiley_category" 
       android:textColor="#fff" 
       android:textSize="30dp" /> 

     </RelativeLayout> 

    </RelativeLayout> 

</LinearLayout> 

<android.support.v7.widget.RecyclerView 
    android:id="@+id/my_recycler_view_sms_smiley" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_margin="3dp" 
    android:scrollbars="vertical" 
    style="@style/scrollbar_shape_style"/> 

мой дизайн страницы код с ScrollView:

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:card_view="http://schemas.android.com/apk/res-auto" 
android:layout_width="fill_parent" 
android:layout_height="200dp" 
android:layout_gravity="center" 
card_view:cardBackgroundColor="#f8f8f8" 
card_view:cardCornerRadius="2dp"> 

<RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="200dp"> 

    <RelativeLayout 
     android:layout_width="fill_parent" 
     android:layout_height="145dp" 
     android:layout_marginLeft="3dp" 
     android:layout_marginRight="3dp" 
     android:layout_marginTop="5dp"> 

     <ScrollView 
      style="@style/scrollbar_shape_style_sms_card" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"> 

      <TextView 
       android:id="@+id/sms_card_statment" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:text="@string/app_info_info" 
       android:textSize="20sp" 
       android:nestedScrollingEnabled="false" /> 

     </ScrollView> 

    </RelativeLayout> 

    <RelativeLayout 
     android:layout_width="fill_parent" 
     android:layout_height="0.5dp" 
     android:layout_alignTop="@+id/sms_card_option_layout" 
     android:layout_marginBottom="3dp" 
     android:layout_marginLeft="30dp" 
     android:layout_marginRight="30dp"> 

     <View 
      android:layout_width="fill_parent" 
      android:layout_height="0.5dp" 
      android:background="@color/sms_card_divid" /> 

    </RelativeLayout> 

    <RelativeLayout 
     android:id="@+id/sms_card_option_layout" 
     android:layout_width="fill_parent" 
     android:layout_height="50dp" 
     android:layout_alignParentBottom="true"> 

     <RelativeLayout 
      android:id="@+id/sms_card_count_layout" 
      android:layout_width="fill_parent" 
      android:layout_height="48dp" 
      android:layout_alignParentBottom="true" 
      android:layout_alignParentRight="true" 
      android:layout_marginRight="20dp"> 

      <ImageView 
       android:id="@+id/sms_card_count_image" 
       android:layout_width="48dp" 
       android:layout_height="48dp" 
       android:padding="2dp" 
       android:src="@drawable/ic_chart_img" 
       android:layout_alignParentRight="true"/> 

      <TextView 
       android:id="@+id/sms_card_count_title" 
       android:layout_width="wrap_content" 
       android:layout_height="48dp" 
       android:layout_toLeftOf="@+id/sms_card_count_image" 
       android:text="@string/sms_card_count" 
       android:layout_marginTop="15dp" 
       android:textSize="18sp" 
       android:textColor="@color/sms_card_count"/> 
      <TextView 
       android:id="@+id/sms_card_count" 
       android:layout_width="wrap_content" 
       android:layout_height="48dp" 
       android:layout_toLeftOf="@+id/sms_card_count_title" 
       android:text="245" 
       android:layout_marginTop="15dp" 
       android:textSize="18sp" 
       android:textColor="@color/sms_card_count"/> 

     </RelativeLayout> 

     <RelativeLayout 
      android:id="@+id/sms_card_share_layout" 
      android:layout_width="48dp" 
      android:layout_height="48dp" 
      android:layout_alignParentBottom="true" 
      android:layout_marginLeft="3dp"> 

      <ImageView 
       android:id="@+id/sms_card_share_image" 
       android:layout_width="48dp" 
       android:layout_height="48dp" 
       android:padding="2dp" 
       android:src="@drawable/ic_share_img" 
       android:onClick="share_text_method"/> 

     </RelativeLayout> 

     <RelativeLayout 
      android:id="@+id/sms_card_copy_layout" 
      android:layout_width="48dp" 
      android:layout_height="48dp" 
      android:layout_alignParentBottom="true" 
      android:layout_marginLeft="3dp" 
      android:layout_toRightOf="@+id/sms_card_share_layout"> 

      <ImageView 
       android:id="@+id/sms_card_copy_image" 
       android:layout_width="48dp" 
       android:layout_height="48dp" 
       android:padding="2dp" 
       android:src="@drawable/ic_copy_img" 
       android:onClick="copy_text_method"/> 

     </RelativeLayout> 

    </RelativeLayout> 

</RelativeLayout> 

На самом деле, я хочу прокрутка TextView, которая находится внутри RecyclerView, показывает это. Чтобы текст не прокручивал полосу прокрутки для повторной прокрутки всей страницы.

пожалуйста, помогите мне и отправить правильный код

ответ

-2

RecyclerView также является ListView, который не требует Scrollview. Если вы хотите использовать write ontouch lisetner. Он работает в соответствии с вашим прикосновением. Но, избегайте scrollview внутри прокрутки для лучшей производительности приложения и его плохой идеи .....

+0

Спасибо, ваши мысли и идеи о том, что делать, чтобы исправить это? Каково ваше решение? –

+0

Мне нужно Scrollview внутри recyclerview .... Мое решение не использует scrollview ... –

Смежные вопросы