Posts

Showing posts with the label PopupWindow in Sketchware

Create PopupWindow in Sketchware

Image
The CustomView can be used to create a custom PopupWindow in Sketchware, by using simple codes. Follow the steps below to create a custom PopupWindow. 1. In VIEW area of your project add a new CustomView ' myview.xml '. 2.  Design the CustomView  the way you want your custom PopupWindow to look like. In the image above, I have added four TextViews, of which two act as buttons (namely ' textview3 ' and ' textview4 '). 3. Choose the event on which you want to show the PopupWindow. It can be onBackPressed or onButtonClick, etc. 4. On the event when dialog is to be shown, use  add source directly  blocks to create and show the PopupWindow. In the image above I have added the code to button1 onClick event. The code used is explained below. a) First create a View from the CustomView layout file (myview.xml) which will be used as PopupWindow. View popupView = getLayoutInflater().inflate(R.layout. myview , null); Note that here 'myview...