2012-02-29 15 views
0

VideoViewを左上に固定し、TextViewをそのすぐ右に置こうとしています。それらの両方の下で、私はチェックボックスのスクロール可能なリストを望んでおり、その下に2つのボタン "prev"と "next"があります。 VideoViewとTextViewはスクロールしてはならず、チェックボックスとボタンだけをスクロールしてはいけません。私はリニアレイアウトでこの作業をすることはできませんので、私はRelativeLayoutを試しましたが、私はすべての相対的なものをハードにコーディングしているので、ちょっと大変です。このタイプのものをレイアウトする最良の方法は何ですか?ここでスクロールリストの下にTextViewの横にVideoViewをレイアウトする方法

おかげで、

ジャスティン

答えて

0

はあなたの説明に合う基本的なレイアウトです:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" > 

     <VideoView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 
    </LinearLayout> 

    <ScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" > 

     <RelativeLayout 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" > 

      <CheckBox android:id="@+id/chk1" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" /> 

      <CheckBox 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:layout_below="@id/chk1"/> 

      <LinearLayout 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:layout_alignParentBottom="true" 
       android:orientation="horizontal" > 

       <Button 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" /> 

       <Button 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" /> 
      </LinearLayout> 
     </RelativeLayout> 
    </ScrollView> 

</LinearLayout> 

VideoViewが大きいのであれば、多分あなたはそれに利用可能なスペースを制限したいと思います囲みの0dp値とlayout_weight属性を使用して、LinearLayoutを指定します。

関連する問題