Question: Java & XML CREATE LAYOUT In the activity_main.xml file, create the layout below using TextViews Make sure each view has a meaningful, unique ID In
Java & XML
CREATE LAYOUT
In the activity_main.xml file, create the layout below using TextViews
Make sure each view has a meaningful, unique ID
In your XML, set an OnClick property for each label.
+------------------------------------------+
| Apple |
| Banana Grape |
| |
| |
| |
| |
| Pear |
| |
| |
| |
| |
| Watermelon |
+-------------------------------------------+
Apple should be anchored to the top left corner
Banana should be under Apple, left-aligned
Grape should be horizontally aligned to Banana, but on the right side of the screen
Pear should be in the middle of the screen
Watermelon should be at the bottom center of the screen
Make sure that there is some spacing between items and the edges. You can do this with padding or margins.
You can create this layout entirely within the screen designer
Code
When you click any fruit text label, it becomes invisible. There is no requirement to make the labels visible again.
- Using the JavaDocs for the "View" class, figure out how to set each TextView to invisible
- Set each view to invisible in the onClick method you set up in XML.
- How many Click Listeners do you need?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
