Extension activity 1: Improving button stability
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.
Fixing the jumping button issue
Return to the
Designer
tab and remove theImage
andButton
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 twoVerticalArrangement
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% andWidth
to fill parent.Modify the properties of the other container: set
Width
tofill parent
.Drop an
Image
component into the first container. Click onVerticalArrangement1
in the components panel and align it to the center both horizontally and vertically.Place a
Button
component into the other container. Click onVerticalArrangement2
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
tofill parent
and change theText
toHide
.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.
Last updated