Monday, March 3, 2014

How to Delete Android Subviews



1. Open the Java Eclipse program used to create and edit Android apps. Open the Android project and double-click the XML file in the 'resource' directory.

2. Locate the subview you want to delete. The following code is an example of a subview named 'mysubview':

android:layout_width='fill_parent'

android:layout_height='fill_parent'

android:orientation='vertical' >

android:layout_width='wrap_content'

android:layout_height='wrap_content'

android:text='This is the main text view object'>

android:layout_width='wrap_content'

android:layout_height='wrap_content'

android:text='This is the subview for the main view'>

3. Delete the subview tag you want to remove. You must delete the entire tag to avoid creating syntax errors when you compile and test the code. Using the example in step two, the following code is the resulting code after the subview is deleted:

android:layout_width='fill_parent'

android:layout_height='fill_parent'

android:orientation='vertical' >

android:layout_width='wrap_content'

android:layout_height='wrap_content'

android:text='This is the main text view object' />

No comments:

Post a Comment