views:

13

answers:

0

I've got an activity with the following layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">
    <com.google.android.maps.MapView
        android:id="@+id/map"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
    <LinearLayout
        android:id="@+id/view"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="center"
        android:padding="5dp" >
        <TextView
            android:id="@+id/text"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:textColor="#FFF"
            android:padding="5dp" />
    </LinearLayout>
</LinearLayout>

I want to be able to hide/show the seperate LinearLayout with id 'view' and then let the MapView resize according to the space left. When I try this the seperate LinearLayout is never shown. I'm not sure what is going on! Is the LinearLayout forever hidden? is it behind the Mapview?

private void showMessage() {
    LinearLayout layout = (LinearLayout) findViewById(R.id.view);
    layout.setVisibility(View.VISIBLE);
}

private void hideMessage() {
    LinearLayout layout = (LinearLayout) findViewById(R.id.view);
    layout.setVisibility(View.GONE);
}