2012-05-04 9 views
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" > 

    <VideoView 
     android:id="@+id/lesson_main_left_videoView" 
     android:layout_width="match_parent" 
     android:layout_height="0dip" 
     android:layout_weight="6" /> 

    <LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/lesson_main_left_LinearLayout" 
     android:layout_width="match_parent" 
     android:layout_height="0dip" 
     android:layout_weight="6" 
     android:orientation="horizontal" > 

     <EditText 
      android:id="@+id/lesson_main_left_record" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:editable="false" 
      android:ems="10" 
      android:singleLine="false" /> 

     <ListView 
      android:id="@+id/lesson_main_left_buddyList" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:animateLayoutChanges="true" /> 
    </LinearLayout> 

    <TableRow 
     android:id="@+id/lesson_main_left_tableRow1" 
     android:layout_width="match_parent" 
     android:layout_height="0dip" 
     android:layout_weight="1" > 

     <EditText 
      android:id="@+id/lesson_main_left_message" 
      android:layout_width="0dip" 
      android:layout_height="wrap_content" 
      android:layout_weight="4" > 
     </EditText> 

     <Button 
      android:id="@+id/lesson_main_left_send" 
      android:layout_width="0dip" 
      android:layout_height="wrap_content" 
      android:layout_weight="1" 
      android:text="SEND" /> 
    </TableRow> 

</LinearLayout> 

答えて

1

はい、あなたは(View.INVISIBLEの代わりに)

setVisibility(View.GONE) 

を使用して、それを行うことができます。

関連する問題