0

I would like to show different elements to the user.
Therefore I would like to hide some elements, while others will show.
However, replaced elements cannot fill up the original area.

So are there any method to replace it.?

<?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>
4

1 回答 1

1

Yes, you can do that, using

setVisibility(View.GONE) 

(instead of View.INVISIBLE).

于 2012-05-04T08:44:27.297 回答