5

In my application I am trying to use a WheelPicker by Bruicetoo its working fine but as I out it inside ScrollView it stops responding and only activity is scrolled but I am unable to scroll the WheelPicker. I have also tried android:nestedScrollingEnabled="true" in picker but didn't work. Minimum SDK version is 21 and target v. 23.

Updated Code

Layout:

    <ScrollView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="90dp"
        android:layout_marginTop="20dp">

        <com.bruce.pickerview.LoopView
            android:id="@+id/loop_view"
            android:layout_width="50dp"
            android:layout_height="90dp"
            android:layout_below="@+id/calendar_view"
            android:layout_marginBottom="20dp"
            android:layout_marginLeft="20dp"
            android:nestedScrollingEnabled="true"
            app:canLoop="true"
            app:centerTextColor="#ff000000"
            app:drawItemCount="7"
            app:initPosition="3"
            app:lineColor="@color/PrimaryBlue"
            app:textSize="12sp"
            app:topBottomTextColor="#ffafafaf" />
    </LinearLayout>
</ScrollView>

Code:

loopView = (LoopView) findViewById(R.id.loop_view);
        loopView.setInitPosition(2);
        loopView.setCanLoop(false);
        loopView.setLoopListener(new LoopScrollListener() {
            @Override
            public void onItemSelect(int i) {
                     Toast.makeText(RegisterRoomActivity.this, StartHr.get(i), Toast.LENGTH_LONG).show();
            }
        });

        loopView.setTextSize(25);//must be called before setDateList
        loopView.setDataList(StartHr);
Machavity
  • 28,730
  • 25
  • 78
  • 91
Mehvish Ali
  • 622
  • 1
  • 9
  • 26
  • Its because scrollable view inside ScrollView creates problem. You can write the code such that when your loopview is scrolling, scrollview does not scroll and when scrollview is scrolling, your loopview should be stable. Try to use NestedScrollView instead of ScrollView.http://stackoverflow.com/questions/6210895/listview-inside-scrollview-is-not-scrolling-on-android – Dhruvi Jul 16 '16 at 04:53
  • Try setting `FillViewPort` to `true` on the `ScrollView`. – Harshad Pansuriya Jul 16 '16 at 04:57
  • @Ironman unfortunately didnt worked for me – Mehvish Ali Jul 16 '16 at 05:06
  • Does your issue solved? – Febi M Felix Feb 28 '17 at 09:46

0 Answers0