开发者

TextView is not Displayed until VideoView start playing

开发者 https://www.devze.com 2023-02-17 04:44 出处:网络
I wrote an android application which has to two views, VideoView above TextView(which is inside a ScrollView), I met a problem that until the VideoView starts playing a video, the TextView is not disp

I wrote an android application which has to two views, VideoView above TextView(which is inside a ScrollView), I met a problem that until the VideoView starts playing a video, the TextView is not displayed and I have a blackscreen, and this might take a long time, since the command to start the video is received from a client via RPC. Could someone please help pointing the problem, either by editing main.xml or using code?

My main.xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">
<VideoView
    android:layout_width="match_parent" 
    android:layout_height=开发者_运维技巧"wrap_content" 
    android:id="@+id/videoview"
/>
<ScrollView   
    android:id="@+id/ScrollView01"  
    android:layout_height="fill_parent"   
    android:layout_width="fill_parent">
<TextView 
    android:layout_width="wrap_content" 
    android:id="@+id/textview" 
    android:layout_height="wrap_content" 
    android:text="Wellcome"
/>
</ScrollView>
</LinearLayout>

And the import in my activity is only:

setContentView(R.layout.main);


i don't think u will have problem in using relative layout like this

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">
<VideoView
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:id="@+id/videoview"
    android:layout_above="@+id/ScrollView01"
/>
<ScrollView   
    android:id="@+id/ScrollView01"  
    android:layout_height="wrap_content"   
    android:layout_width="fill_parent"
    android:layout_gravity="bottom"
    android:layout_alignParentBottom="true"
    >
<TextView 
    android:layout_width="wrap_content" 
    android:id="@+id/textview" 
    android:layout_height="wrap_content" 
    android:text="Wellcome"
/>
</ScrollView>
</RelativeLayout>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号