在ScrollView内部填充时,Android VideoView不会扩展

时间:2017-03-15 15:22:41

标签: android android-layout android-videoview

此视频视图不会展开并将我的视频放入视图中。如果我设置静态高度和宽度(例如640dp 400dp),视频将成功填充视图并按预期工作。

这个问题出现在我进入ScrollView设置之后 - 它曾经在它自己的父LinearLayout中正常工作。

VideoView的XML:

struct Account{ 
int accountNumber;
string lastName;
string firstName;
double accountBalance;
};

//function prototype
template <typename typeStruct>
void makeAccount(vector <typeStruct>&);


//makeAccount method
void makeAccount(vector<T>&v)
{
    T newacc;
    newacc.accountNumber=rand()%9000+1000;
    cout<<"Creating bank account number "<<newacc.accountNumber<<endl;
    cout<<"Enter first name: ";
    cin>>fname;
    newacc.firstName=fname;
    cout<<"Enter last name: ";
    cin>>lname;
    newacc.lastName=lname;
    cout<<"Enter starting balance: ";
    cin>>principal;
    newacc.accountBalance=principal;

}

1 个答案:

答案 0 :(得分:0)

android:fillViewPort=true添加到滚动视图并匹配父级

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:fillViewPort=true
    android:layout_height="match_parent"
    android:background="@color/gray">