Hope there is a solution here, I have XML TimePicker and ScrollView in my main.xml, and with the setting TimePicker does not scroll. If I remove ScrollView, Timepicker will scroll just fine, but obviously I need both.
It seems that both of them are struggling to get touch events, but this causes problems.
Here is my code:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_height="match_parent" android:layout_width="match_parent" android:background="@color/backgroundmain"> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView /> <TextView /> <TextView /> <TextView /> <RelativeLayout android:id="@+id/TimePickerSection" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_marginTop="5dp" android:layout_centerHorizontal="true" android:layout_below="@id/"> <TimePicker android:id="@+id/TimePick" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_centerVertical="true" android:layout_below="@id/HaveToText"/> <Button android:id="@+id/OkButton" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/OkText" android:layout_below="@id/HaveToText" android:textSize="20sp" android:onClick="TimePickButton" android:layout_centerVertical="true" android:layout_toRightOf="@id/TimePick"/> </RelativeLayout> <TextView /> <TextView /> <Button /> </RelativeLayout> </ScrollView>
I deleted the unnecessary code, but retained the outlines to show you how the layout is laid out.
Is there a fix in XML? I tried things like android:fillViewPort="" but did nothing. My TimePicker is not part of the dialogue or anything else, and I hope I can save it that way.
RED_
source share