Create Custom Popup Window using Sketchware
Refer the video below if you get stuck.
1) Add a custom view named window.You can name it according to your wish.
2)Design your popup window.
2) Now, In the logic section,In OnCLick event of button.Add the following code
Create a view
View popupView = getLayoutInflater().inflate(R.layout.window, null);
Popup window
final PopupWindow popup = new PopupWindow(popupView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
Initialize
Button b1 = popupView.findViewById(R.id.button1);
Button b2 = popupView.findViewById(R.id.button2);
OnClickListeners
b1.setOnClickListener(new OnClickListener() { public void onClick(View view) {
//below code will dismiss the popup window
popup.dismiss();
} });
b2.setOnClickListener(new OnClickListener() { public void onClick(View view) {
popup.dismiss();
} });
Show the popup window
popup.showAtLocation(popupView, Gravity.CENTER, 0, 0);
i think you need a screenshot of block... for better understanding...
ReplyDeleteThank you for your fedback
DeleteYes ,please
DeleteI want to add a sticky webview on top , and other item will scroll below it in sketware, can you help me ?
ReplyDeleteI think you need to search for Relative Layout Design for this to work. You can make a window on top of another using Relative Layout
DeleteHow to Close (dismiss) the view on an another Method?
ReplyDeleteFor example: Show view in on create and dismiss it on Network Response (componement requests Network on Response) ? It says Always that it can not be resolved to a variable...
How to design dialog layout?
ReplyDelete