Hoffentlich eine Lösung gibt es hier, habe ich einen XML-Timepicker und Scroll in meinem main.xml und mit dem Aufbau der Timepicker bewegen sich nicht. Wenn ich die ScrollView entferne, scrollt der Timepicker gut, aber offensichtlich brauche ich beides.Scroll mit Scroll von Timepicker kämpfen, Timepicker nicht als Ergebnis Scrollen
Es scheint, als ob sie beide kämpfen, um die Berührungsereignisse zu bekommen, aber es verursacht Probleme.
Hier ist mein 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">
<!-- Action Title -->
<ImageView />
<TextView />
<!-- Description -->
<TextView />
<!-- Have to Button -->
<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>
<!-- OR -->
<TextView />
<!-- buttons -->
<TextView />
<Button />
</RelativeLayout>
</ScrollView>
ich den irrelevant Code entfernt habe, behielt aber die Umrisse nur um Ihnen zu zeigen, wie das Layout aus gelegt.
Gibt es eine Fehlerbehebung im XML? Ich habe versucht, Dinge wie android:fillViewPort=""
, aber das hat nichts getan. Mein TimePicker ist nicht Teil eines Dialogs oder irgendetwas und hoffentlich kann ich es so halten.
Das ist mein Tag gerettet! –