Extension activity 1: Improving button stability
Last updated
Was this helpful?
Last updated
Was this helpful?
While testing your app, you might have observed that the show/hide button exhibits a noticeable jump on the screen when clicked. Although it may seem minor, delivering a seamless user experience is crucial. Let's address this issue and enhance the app's usability.
Proceeding may result in code loss. To safeguard your code, navigate to the Blocks
tab, right-click on your code, and select Add to Backpack
. This action saves the code in the backpack for retrieval later.
Return to the Designer
tab and remove the Image
and Button
from the screen, leaving it empty.
You may encounter a warning message; click on
Save the empty screen now
to proceed.
Click on the Layout
tab in the left panel (Panel 1) and drag two VerticalArrangement
blocks onto the screen.
Layouts serve as containers for arranging multiple components, facilitating the organisation of buttons, navigation panels, etc.
Adjust the properties of the first container: set Height
to 80% and Width
to fill parent.
Modify the properties of the other container: set Width
to fill parent
.
Drop an Image
component into the first container. Click on VerticalArrangement1
in the components panel and align it to the center both horizontally and vertically.
Place a Button
component into the other container. Click on VerticalArrangement2
in the components panel and align it to the center both horizontally and vertically.
Click on the Image
component and select the uploaded image.
Optionally, adjust the
Height
property of the image if needed.
Set the button's Width
to fill parent
and change the Text
to Hide
.
Navigate to the Blocks
screen and click on the backpack icon. Drag and drop the saved code into the code area.
You are done! Test the app to ensure the button now operates smoothly without any jumping issues.