Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
879 views
in Technique[技术] by (71.8m points)

android - glsurfaceview inside a scrollview, moving but not clipping

I have a scrollview with a linear layout inside. One of the elements inside this linearlayout is a glsurfaceview.

This all works correctly and when I scroll the glsurfaceview moves up and down however when the glsurfaceview reaches the top or bottom of where it should of the scrollview where it should be clipped it is not and is continued outside of the scrollview. This screenshot should make it clearer:

glsurfaceview not clipped correctly

Don't think it's completly nessecary but here is my layout.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:orientation="vertical"
android:padding="6dip"
>
<ScrollView
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
>
    <LinearLayout
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical"
    >
        <LinearLayout
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:orientation="horizontal"
        >
            <LinearLayout
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" 
            android:orientation="vertical"
            android:layout_weight="1"
            >
            <!-- LOTS OF SEEKBARS/TEXTVIEWS -->
            </LinearLayout>
            <LinearLayout
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content" 
                android:layout_weight="1.4"
                android:layout_marginRight="10dip"
                android:layout_marginLeft="10dip"
                android:orientation="horizontal" >
                <android.opengl.GLSurfaceView android:id="@+id/glview"  
                android:layout_width="100px"
                android:layout_height="250px"/>
            </LinearLayout>
        </LinearLayout>

        <LinearLayout
        android:layout_marginTop="6dip"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:layout_weight="1"
        android:orientation="horizontal" >
            <!-- OK/CANCEL BUTTONS -->
        </LinearLayout>
    </LinearLayout>
</ScrollView>
</LinearLayout>

All help much appreciated :)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Hosting SurfaceViews inside ScrollView (or Listview, etc.) is currently not supported.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...