Android-Scrollview mit videoview ist was problem
Habe ich ein VideoView, der innerhalb einer scrollView. Wenn ich das scrollen der scrollView, die VideoView verschiebt sich nicht mit. Es ist wie seine position fixiert ist. Hier ist mein layout:
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFFFFF">
<LinearLayout android:id="@+id/BackBar" android:orientation="vertical" android:layout_width="fill_parent" android:paddingTop="2dp" android:layout_height="wrap_content" android:background="#D6DEAA">
<Button android:id="@+id/BackButton" android:layout_gravity="left" android:text="@string/BackButtonText" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<ScrollView android:id="@+id/scroll1" android:layout_height="fill_parent" android:layout_width="fill_parent">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFFFFF">
<LinearLayout android:id="@+id/contentVideo" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingLeft="30px" android:paddingTop="15px" android:background="#FFFFFF">
<TextView android:id="@+id/learn_hiv_blck1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/learn_hiv_blck1" android:textColor="#000000" android:textStyle="italic" android:background="#FFFFFF" android:layout_gravity="left" />
<TextView android:id="@+id/learn_hiv_blck2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="15px" android:text="@string/learn_hiv_blck2" android:textColor="#000000" android:background="#FFFFFF" android:layout_gravity="left" />
<TextView android:id="@+id/learn_hiv_blck3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="15px" android:text="@string/learn_hiv_blck3" android:textColor="#000000" android:background="#FFFFFF" android:layout_gravity="left" />
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#FFFFFF">
<VideoView android:id="@+id/VideoView" android:layout_width="283dip" android:layout_height="183dip" />
</LinearLayout>
</LinearLayout>
<LinearLayout android:id="@+id/contentVideo" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingLeft="30px" android:paddingTop="15px" android:paddingBottom="40dip" android:background="#FFFFFF">
<TextView android:id="@+id/learn_hiv_blck4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/learn_hiv_blck4" android:textColor="#000000" android:background="#FFFFFF" android:layout_gravity="left" />
<VideoView android:id="@+id/VideoView1" android:layout_width="280dip" android:layout_height="190dip" android:visibility="gone" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
Was ist das problem in meinem layout?
- Ich habe das gleiche problem. Die Oberfläche ist ein Loch in den Bildschirm, wo er will, zu zeichnen, aber es bewegt sich nicht mit dem layout. Ich bin versucht derzeit, eine Lösung zu finden, und ich bin immer Angst, dass werde ich brauchen, um dies zu tun, die in nativem code. Im Fall einer von diesen beantwortet bekommt, ist hier eine andere Frage zum selben Thema: stackoverflow.com/questions/4312585/...
- VideoView erbt von SurfaceView, die änderungen der Regeln des scrolling-Verhalten. Eine SurfaceView ist im Grunde ein Zwischenstopp auf der Spitze von was auch immer sonst noch Los ist, und wie es scheint, Sie sind auf Ihre eigenen so weit wie updates betroffen sind. Siehe auch diese Frage, wenn es hilft bei allem: stackoverflow.com/questions/1096618/...
- Sie sind sich bewusst, dass das kopieren/einfügen von Antworten auf mehrere Fragen ist verpönt hier, richtig? (stackoverflow.com/questions/6434646)
Du musst angemeldet sein, um einen Kommentar abzugeben.
Könnten Sie auch für Ihre
VideoView
:android:background="#0000"
?Romain Guy reagierte auf diese Android bug-report:
nicht zum scrollen videoview während der Wiedergabe wie beschrieben hier.
hatte ich ein videoview im inneren viewpage, wenn ich scrollen ich das video auf pause und zeigen Sie Bild oben drauf. "myby diese Arbeit kann helfen,"
Call
requestLayout()
für die video-anzeigen. Es gelöst gleiche Problem für mich.