| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Tags
- error
- java
- effective
- kibana
- 자바
- 엘라스틱서치
- MySQL
- RCP
- boot
- 자바스크립트
- 스프링
- jface
- Spring Boot
- JPA
- 후기
- nodejs
- elasticsearch
- 리뷰
- java8
- Spring
- 알고리즘
- 인터페이스
- node
- 백준
- Web
- Git
- javascript
- 독후감
- 맛집
- 이펙티브
Archives
- Today
- Total
wedul
뒤로가기 버튼 차단 본문
반응형
앱의 비밀번호 입력 페이지등을 만들다 보면
뒤로가기 버튼을 막아야 하는 경우가 있다.
이 경우 platform에서 제공하는 뒤로가기 버튼 Action을
재정의하여 차단한다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | // Property used to store the callback of the event handler to unsubscribe to it when leaving this page public unregisterBackButtonAction: any; constructor(...) { ... } ionViewDidEnter() { this.initializeBackButtonCustomHandler(); } ionViewWillLeave() { // Unregister the custom back button action for this page this.unregisterBackButtonAction && this.unregisterBackButtonAction(); } public initializeBackButtonCustomHandler(): void { this.unregisterBackButtonAction = this.platform.registerBackButtonAction(() => { this.customHandleBackButton(); }, 10); } private customHandleBackButton(): void { // do what you need to do here ... } // Property used to store the callback of the event handler to unsubscribe to it when leaving this page public unregisterBackButtonAction: any; constructor(...) { ... } ionViewDidEnter() { this.initializeBackButtonCustomHandler(); } ionViewWillLeave() { // Unregister the custom back button action for this page this.unregisterBackButtonAction && this.unregisterBackButtonAction(); } public initializeBackButtonCustomHandler(): void { this.unregisterBackButtonAction = this.platform.registerBackButtonAction(() => { this.customHandleBackButton(); }, 10); } private customHandleBackButton(): void { // 뒤로가기 버튼 Action 재 정의 } | cs |
반응형