我的应用程序活动有以下 xml 结构。现在我想用 id layer1Front 以编程方式删除子 RelativeLayout。我将如何在代码中做到这一点。我不想隐藏它,由于我的应用程序中的内存问题,我需要将其删除。同样在以某种方式删除它之后,我的应用程序会比当前的应用程序更轻、更快吗?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/layer1Front" >
</RelativeLayout>
<HorizontalScrollView android:layout_width="wrap_content"
android:layout_height="wrap_content">
<FrameLayout android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:id="@+id/parallaxLayers"
android:visibility="gone">
</FrameLayout>
</HorizontalScrollView>
<RelativeLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/frontView">
</RelativeLayout>
</RelativeLayout>