sayyam / carouselview

A simple library to add carousel view in android app.
Apache License 2.0
1.15k stars 260 forks source link

CarouselView does not show any images when used from inside of a ScrollView #63

Open monodeepdas1215 opened 7 years ago

monodeepdas1215 commented 7 years ago

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">

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

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <com.synnapps.carouselview.CarouselView
        android:id="@+id/carouselView"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        app:fillColor="#FFFFFFFF"
        app:pageColor="#00000000"
        app:radius="6dp"
        app:slideInterval="3000"
        app:strokeColor="#FF777777"
        app:strokeWidth="1dp"/>
</ScrollView>

`

When I had this no images was being displayed but when I removed the ScrollView outside of it images were displayedd fine then.

Akela74 commented 7 years ago

Same trouble

arunavo4 commented 7 years ago

same problem !!! how to fix it ?

Akela74 commented 7 years ago

I'm using ViewFlipper outside the ScrollView

<ViewFlipper
    android:id="@+id/carouselBanners"
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:layout_marginTop="8dp"
    android:autoStart="true"
    android:flipInterval="1500"
    android:inAnimation="@anim/flipin"
    android:outAnimation="@anim/flipout">

    <ImageView
        android:id="@+id/imageView6"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:contentDescription="@string/bannersous"
        app:srcCompat="@drawable/lenta_banner"/>

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        app:srcCompat="@drawable/magnit_banner"/>

    <ImageView
        android:id="@+id/imageView5"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:contentDescription="@string/bannerbakalea"
        app:srcCompat="@drawable/perekrestok_banner"/>

    <ImageView
        android:id="@+id/imageView4"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:contentDescription="@string/bannermagnit"
        app:srcCompat="@drawable/pyaterochka_banner"/>

</ViewFlipper>

Try. Perhaps ViewFlipper likes ScrollView

wongmingrui commented 6 years ago

Just insert a linearlayout in between will do.

ScrollView LinearLayout CarousellView