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

1 に答える 1

1

はい、あなたはそれを行うことができます

setVisibility(View.GONE) 

(View.INVISIBLE の代わりに)。

于 2012-05-04T08:44:27.297 に答える